OCA / margin-analysis

Odoo Financial Controlling (margin, costs, ...)
https://odoo-community.org/project/9
GNU Affero General Public License v3.0
74 stars 161 forks source link

[16.0][MIG] product_margin_classification #169

Closed legalsylvain closed 1 year ago

legalsylvain commented 1 year ago

/ocabot migration product_margin_classification

legalsylvain commented 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 !

vdewulf commented 1 year ago

@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!

legalsylvain commented 1 year ago

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 ?

victor-champonnois commented 1 year ago

@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.

dreispt commented 1 year ago

/ocabot merge nobump

OCA-git-bot commented 1 year ago

On my way to merge this fine PR! Prepared branch 16.0-ocabot-merge-pr-169-by-dreispt-bump-nobump, awaiting test results.

OCA-git-bot commented 1 year ago

Congratulations, your PR was merged at a8eef9ac36da8be6ee0ecc165eb35800a8add9c0. Thanks a lot for contributing to OCA. ❤️