-
-
Notifications
You must be signed in to change notification settings - Fork 161
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
[16.0][FIX] sale_margin_delivered: Avoid rounding error #214
[16.0][FIX] sale_margin_delivered: Avoid rounding error #214
Conversation
Hi @sergio-teruel, |
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.
Wonderful, checked code and does the same
@Shide I'll change this since |
e289eb6
to
4514ace
Compare
'price_reduce' is deprecated and removed into the next version. Compute the prirce_reduct from the price_subotal / product_uom_qty. We might be tempted to use the 'price_reduce_taxecl' field from the sale order line but this field is rounded by default to the monetary precision. As an additional benefit this change ensures the compatibility with the 'sale_triple_discount' addon. Indeed, when 'sale_triple_discount' is installed, the discount field is not used as an aggregation of all the applied discount. It's only use to store the first discount applied. Therefore, the field is not properly computed since it doesn't include the second and third discount.
4514ace
to
461a076
Compare
@Shide @yajo @Gelojr @fcvalgar In Odoo standard margin in % is expressed as a decimal... 1 = 100%, 0.5=50% ... In this module margin % is expressed as 100 = 1000%, 50 = 50%... what's the motivation. It's strange to store precentage value in a different way than Odoo. Can I change this and provide a migration script? |
Put all the new fields after the orginal margin fields from odoo. (prior to this change, the new fields were displayed among the margin fields from Odoo
461a076
to
6f36c4f
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.
Sure! |
This would be an amazing great contribution @lmignon ! 💪🏼 😄 Thank you! |
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
Could be closed in favor of #215 |
included into #215 |
'price_reduce' is deprecated and removed into the next version. Compute
the prirce_reduct from the price_subotal / product_uom_qty. We might
be tempted to use the 'price_reduce_taxecl' field from the sale order
line but this field is rounded by default to the monetary precision.
As an additional benefit this change ensures the compatibility with
the 'sale_triple_discount' addon. Indeed, when
'sale_triple_discount' is installed, the discount field is not used
as an aggregation of all the applied discount. It's only use to store
the first discount applied. Therefore, the field is not properly
computed since it doesn't include the second and third discount.