diff options
| author | Goffin Simon <sig@odoo.com> | 2020-12-07 15:57:53 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2020-12-07 15:57:53 +0000 |
| commit | 880555b38dee0c3e3b364c19bb6b0db983bf8aa0 (patch) | |
| tree | 7db36c3be784abac292b2778faf7f2c934b72af0 /addons | |
| parent | 3d1c7231a080eebb4f6a7d56cbfa5721bf76befd (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>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/sale/models/sale.py | 2 |
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) |
