-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
ADD sale_commission_geo_assign #183
Conversation
e073cc1
to
6be2139
Compare
@pedrobaeza This explains a bit why I made #181 |
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.
Some nitpicking but none blocking.
EDIT: Tested locally as runbot instance seems do not work properly
"views/res_partner_view.xml", | ||
"wizard/wizard_geo_assign_partner_view.xml", | ||
], | ||
"demo": [ |
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.
please remove empty key
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.
done
self.assertFalse(c1.agents) | ||
|
||
agent2 = self.partner_model.create({ | ||
'name': 'agent1', |
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.
maybe agent2
?
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.
done
'zip_from': '16100', | ||
'zip_to': '17100', | ||
}) | ||
wizard.geo_assign_partner() |
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.
shouldn't raise an exception considering that c2
has already agents? 😕
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.
@tafaRU no, because wizard.check_existing_agents = False
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.
Ok, I missed it! Thanks for the explanation.
6be2139
to
bd309a1
Compare
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.
Thanks for your contribution!
"views/res_partner_view.xml", | ||
"wizard/wizard_geo_assign_partner_view.xml", | ||
], | ||
"demo": [ |
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.
remove
class Partner(models.Model): | ||
_inherit = 'res.partner' | ||
|
||
country_ids = fields.Many2many( |
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.
Maybe this field name is a bit too generic, something like agent_country_ids
or similar would be better I think.
Same for other fields
raise UserError(_( | ||
"Partner %s already has agents. You should remove them" | ||
" or deselect 'Check existing agents'" | ||
) % partner.name) |
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.
Maybe display_name
would be better
}} | ||
|
||
@api.multi | ||
def verify_agent(self, partner): |
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.
Please add a little documentation to make it clear what this method does: Check if it is ok to assign this agent to the partner
or similar
|
||
Sales > Commissions Management > Agents | ||
|
||
For every agent, you can set Countries, States or ZIP range |
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 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.
Indeed! I made my own tests locally as It's written in my review comment.
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 is because of
<page name="agent_information" position="replace"> |
I am going to fix
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.
@SimoRubi I made the other changes meanwhile
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.
bd309a1
to
adc4ddd
Compare
Then add here that filter, not in the general one 😉 Any way, you should put only one of them (the most relevant one) IMO. |
96c2d84
to
f67398b
Compare
@pedrobaeza right, done |
f67398b
to
fa776aa
Compare
Merged #184 and rebased this |
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.
code & runbot review, ok for me
This PR has the |
No description provided.