Skip to content

Conversation

@rousseldenis
Copy link
Contributor

@rousseldenis rousseldenis commented Dec 10, 2025

image

@rrebollo
Copy link

rrebollo commented Dec 13, 2025

@rousseldenis given the picture in PR description, is the design/inspiration for this feature influenced by or related to the EE?

Copy link

@rrebollo rrebollo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review. LGTM!

Comment on lines 15 to 30
@api.depends("product_id", "order_id.pricelist_id", "base_price")
def _compute_has_discount_price(self):
lines_with_product = self.filtered("product_id")
for line in lines_with_product:
pricelist_price = line._get_pricelist_price()
base_price = line.base_price
line.has_discount_price = bool(pricelist_price < base_price)
(self - lines_with_product).has_discount_price = False

@api.depends("product_id")
def _compute_base_price(self):
lines_with_product = self.filtered("product_id")
for line in lines_with_product:
base_price = line._get_pricelist_price_before_discount()
line.base_price = base_price
(self - lines_with_product).base_price = False

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you consider compute both fields in a single method? I'm not sure it would be a good idea due to the differences in the re computation triggers but ... I'm just asking

… base price computation method

In some cases, we want to display the base price from pricelists based on formulas and not
only on discount cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants