Skip to content
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

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

nguyenminhchien
Copy link

No description provided.

@nguyenminhchien nguyenminhchien marked this pull request as ready for review March 21, 2024 04:21
@nguyenminhchien nguyenminhchien force-pushed the 16.0-mig-product_pricelist_margins branch from d577643 to 9e28a94 Compare March 21, 2024 04:43
)

@api.depends("fixed_price", "cost")
def _compute_margin(self):
Copy link
Contributor

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

Copy link
Contributor

@legalsylvain legalsylvain left a 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

with Form(self.line) as line:
line.compute_price = "percentage"
self.assertEqual(line.cost, 20.0)
self.assertEqual(line.margin, 0)
Copy link
Contributor

@santostelmo santostelmo Mar 22, 2024

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 ? 🤔

@cyrilmanuel
Copy link

Hii @legalsylvain is it good for you ?

have a great day

@legalsylvain
Copy link
Contributor

No. Margin is still bad computed. See previous comment.

@chaule97 chaule97 force-pushed the 16.0-mig-product_pricelist_margins branch from 03916fe to 6b38ca0 Compare July 10, 2024 09:05
@chaule97 chaule97 force-pushed the 16.0-mig-product_pricelist_margins branch from 6b38ca0 to 0905b26 Compare July 10, 2024 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants