Skip to content

Commit 5486e66

Browse files
committed
[IMP] product_pricelist_alternative: force_price_recomputation
1 parent 5822698 commit 5486e66

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

product_pricelist_alternative/models/product_pricelist.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ def _compute_price_rule(
6767
compute_price=True,
6868
**kwargs,
6969
):
70+
# This context key is used in `sale.order::_recompute_prices()`,
71+
# triggered by `action_update_prices()` button that recomputes
72+
# the unit price of all products based on the new pricelist.
73+
if self.env.context.get("force_price_recomputation"):
74+
compute_price = True
75+
7076
res = super()._compute_price_rule(
7177
products,
7278
quantity,
@@ -76,7 +82,6 @@ def _compute_price_rule(
7682
compute_price=compute_price,
7783
**kwargs,
7884
)
79-
8085
# In some contexts we want to ignore alternative pricelists
8186
# and return the original price
8287
if self.env.context.get("skip_alternative_pricelist", False):

0 commit comments

Comments
 (0)