summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2020-12-07 15:57:53 +0000
committerGoffin Simon <sig@odoo.com>2020-12-07 15:57:53 +0000
commit880555b38dee0c3e3b364c19bb6b0db983bf8aa0 (patch)
tree7db36c3be784abac292b2778faf7f2c934b72af0
parent3d1c7231a080eebb4f6a7d56cbfa5721bf76befd (diff)
[FIX] sale: Optional product price
Steps to reproduce the bug: - Let's consider a product P with sale UOM = Unit and unit price = 10€ - Create a SO and add a sale.order.option SOO with P and Dozen as UOM Bug: The unit price was 10€ instead of 120€ opw:2413237 closes odoo/odoo#62973 Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
-rw-r--r--addons/sale/models/sale.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py
index 1093e432ba8..f78c894d09d 100644
--- a/addons/sale/models/sale.py
+++ b/addons/sale/models/sale.py
@@ -1635,7 +1635,7 @@ class SaleOrderLine(models.Model):
)
if self.order_id.pricelist_id.discount_policy == 'with_discount':
- return product.with_context(pricelist=self.order_id.pricelist_id.id).price
+ return product.with_context(pricelist=self.order_id.pricelist_id.id, uom=self.product_uom.id).price
product_context = dict(self.env.context, partner_id=self.order_id.partner_id.id, date=self.order_id.date_order, uom=self.product_uom.id)
final_price, rule_id = self.order_id.pricelist_id.with_context(product_context).get_product_price_rule(product or self.product_id, self.product_uom_qty or 1.0, self.order_id.partner_id)