Closed legalsylvain closed 1 year ago
@vdewulf : could you take a look on that module ? I remember that you had another implementation of that feature. convergence could be great !
@victor-champonnois Can you follow up this topic please with Sylvain? I'll give you the context of our discussion in April in Lyon. Thanks!
Hi @victor-champonnois.
Some comments : why isn't the field "Theorical Margin (%)" called Markup rate (as it is called in the field description) ? That would make more sense I think.
Sorry, I think there is a misunderstood here. this module product_margin_classification
doesn't introduce the field Theorical Margin (%)
. It is introduced by another module product_standard_margin
. (https://github.com/OCA/margin-analysis/tree/15.0/product_standard_margin#product-margin-and-margin-rate)
I'll do a PR, because indeed, the field is bad named I think.
Could you add in the code, or in the readme an explanation of the math, or a relevant link ?
The readme contains that text :
This module use both [Markup](https://en.wikipedia.org/wiki/Markup_(business))
and [Profit Margin](https://en.wikipedia.org/wiki/Profit_margin) concepts.
Here are the current help on the field :
markup = fields.Float(
help="Value that help you to compute the sale price, based on your"
" cost, as defined: Sale Price = (Cost * (100 + Markup)) / 100\n"
"It is computed with the following formula"
" Markup = 100 * (Sale Price - Cost) / Cost",
)
profit_margin = fields.Float(
help="Also called 'Net margin' or 'Net Profit Ratio'.\n"
"It is computed with the following formula"
" Profit Margin = 100 * (Sale Price - Cost) / Sale Price",
)
What do you propose ?
@legalsylvain Ah I see that in the wikipedia links there is a formula for conversion from markup to margin that correspond to your computation, so you can ignore my comment.
/ocabot merge nobump
On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-169-by-dreispt-bump-nobump, awaiting test results.
Congratulations, your PR was merged at a8eef9ac36da8be6ee0ecc165eb35800a8add9c0. Thanks a lot for contributing to OCA. ❤️
/ocabot migration product_margin_classification