-
-
Notifications
You must be signed in to change notification settings - Fork 246
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[9.0] sales_team_operating_unit #35
[9.0] sales_team_operating_unit #35
Conversation
@api.multi | ||
@api.constrains('team_id', 'operating_unit_id') | ||
def _check_team_operating_unit(self): | ||
for rec in self: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constraint has no sense. Makes a related field if you want this behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The team_id is not a required field in the lead. You might have a lead for an operating unit not associated to a sales team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The team_id is not a required field in the lead. You might have a lead for an operating unit not associated to a sales team.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but if present, you're not allowing to change it, so it doesn't make too much sense to have it. Also the message is not correct. It says 'company' instead of operating unit.
|
||
* Adds the Operating Unit (OU) to the Sales Team. | ||
|
||
* The user’s default Operating Unit (OU) is proposed at the time of creating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/`/'
|
||
|
||
class CRMLead(models.Model): | ||
|
||
_inherit = 'crm.lead' | ||
|
||
@api.model |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can't add this code here, as there's no dependency to the other module. Do it in the proper module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now, there's dependency. I think it's ok, isn't it?
@@ -0,0 +1,16 @@ | |||
# -*- coding: utf-8 -*- | |||
# © 2015 Eficent Business and IT Consulting Services S.L. - | |||
# Jordi Ballester Alomar |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't include 2 copyright lines. Make it in one
# Groups | ||
self.grp_sale_mngr = self.env.ref('base.group_sale_manager') | ||
self.grp_user = self.env.ref('base.group_user') | ||
# Company |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need for these comments. You can use significant variable names instead.
a3ad6d4
to
d0ee4ea
Compare
As long as crm depends on sales_team, crm_operating_unit depends on sales_team_operating_unit. Consequently this PR changes crm_operating_unit to adapt the tests. |
1 similar comment
I Don't know why coverage decreases, IMO tests cover all what this module introduces. |
Call crm_team standard to get team
Thank you @pedrobaeza |
2 similar comments
@pedrobaeza can you reconsider your review? thanks |
The review from @pedrobaeza refers to the module crm, that has already been merged. |
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
* [ADD] sales_team_operating_unit
No description provided.