-
-
Notifications
You must be signed in to change notification settings - Fork 344
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_product_criteria_domain #434
[ADD] sale_commission_product_criteria_domain #434
Conversation
258cfc8
to
2996e54
Compare
@ilyasProgrammer can you rebase? |
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.
Functional ok!
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 fix comments
def write(self, values): | ||
res = super().write(values) | ||
if self.group_id and len(self.group_id.commission_ids.ids) == 0: | ||
self.group_id.commission_ids = [(6, 0, self.commission_id.ids)] |
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.
Better use write
function.
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.
@geomer198 why ?
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.
I think this solution is possible.
sale_commission_product_criteria_domain/models/commission_group.py
Outdated
Show resolved
Hide resolved
sale_commission_product_criteria_domain/models/commission_group.py
Outdated
Show resolved
Hide resolved
4b98af5
to
efbee9c
Compare
e6cde2f
to
d4d4069
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.
Functional ok after adding tests
As per description:
This module allows to manage the following commission structure use case:
Agent A receives commission 50 when selling product 1 to customer X
Agent A receives commission 20 when selling product 1 to customer Y
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 Review ok!
@pedrobaeza can we merge? We worked hard on this :) |
This PR has the |
"category": "Sales Management", | ||
"license": "AGPL-3", | ||
"depends": [ | ||
"sale_commission_product_criteria_discount", |
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 dependency shows a non-desired coupling between modules. Maybe this should be split into 2: one for base product criteria, and another for the discounts.
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.
Thats right. I redid it to depend only on sale_commission_product_criteria
d3c8192
to
08b0857
Compare
cabe534
to
641c2c4
Compare
@pedrobaeza Could you merge please |
|
||
Agent A receives commission 20 when selling product 1 to customer Y | ||
|
||
This behavior is integrated with both pricelist-like Commission Type structure (sale_commission_product_criteria) and commission by discount (sale_commission_product_criteria_discount) |
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.
Incorrect text?
641c2c4
to
e4a6d48
Compare
/ocabot merge patch |
Hey, thanks for contributing! Proceeding to merge this for you. |
Congratulations, your PR was merged at c829aa1. Thanks a lot for contributing to OCA. ❤️ |
No description provided.