Closed lmignon closed 2 months ago
Hi @sergio-teruel, some modules you are maintaining are being modified, check this out!
@Shide @yajo Can you take a look at this one plz?
@shide I'll change this since price_reduce_taxexcl
is rounded and therefore the margin is not properly computed when we've more than 1 product.
@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?
@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?
Sure!
@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?
This would be an amazing great contribution @lmignon ! 💪🏼 😄 Thank you!
Could be closed in favor of https://github.com/OCA/margin-analysis/pull/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.