-
-
Notifications
You must be signed in to change notification settings - Fork 666
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] product_pricelist_margins #1561
base: 16.0
Are you sure you want to change the base?
[ADD] product_pricelist_margins #1561
Conversation
d577643
to
9e28a94
Compare
) | ||
|
||
@api.depends("fixed_price", "cost") | ||
def _compute_margin(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.
Can you please add a unit test the behavior of this method with using pricelist item with a different price computation ?
For example : percentage or formula
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.
Interesting module. However, if you want to compute margin you should depends on account to take into account the vat that can be included.
See similar module : https://github.com/OCA/product-attribute/blob/16.0/product_pricelist_simulation_margin/wizards/wizard_preview_pricelist.py#L42
9e28a94
to
03916fe
Compare
with Form(self.line) as line: | ||
line.compute_price = "percentage" | ||
self.assertEqual(line.cost, 20.0) | ||
self.assertEqual(line.margin, 0) |
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.
We apply 20% discount and the margin is 0 ? 🤔
Hii @legalsylvain is it good for you ? have a great day |
No. Margin is still bad computed. See previous comment. |
03916fe
to
6b38ca0
Compare
6b38ca0
to
0905b26
Compare
No description provided.