From 6bc1de5276f73d9ab63b396b6e403d3606a5ef6c Mon Sep 17 00:00:00 2001 From: Goffin Simon Date: Wed, 30 Oct 2019 13:33:16 +0000 Subject: [PATCH] [FIX] website_sale: Wrong price_unit in the cart Steps to reproduce the bug: - Let's consider two companies C1 and C2 - Let's consider website W - Activate multi-company - Disable common contact book and common catalog - Switch the superuser in company C2 - Activate pricelist - Create a public pricelist PL for C1 and available on W - Set up a pricelist with compute price = formula and based on = cost - Go Sales > Configuration > tick Multiple Sales Prices per Product and tick Prices computed from formulas - Create a portal user PU and set PL on him - Create a product P with cost = 10$ and publish it on W - Set up the product valuation as: automated - Log as PU and go on the shop - Put P on your cart Bug: The price of P was 0$ instead of 10$ opw:2092695 closes odoo/odoo#39638 X-original-commit: b49bf15040748200ad68b557ccdc96eed46c3464 Signed-off-by: Simon Goffin (sig) --- addons/website_sale/models/sale_order.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 3cb129b2abc..58162810309 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -100,6 +100,7 @@ class SaleOrder(models.Model): 'quantity': qty, 'date': order.date_order, 'pricelist': order.pricelist_id.id, + 'force_company': order.company_id.id, }) product = self.env['product.product'].with_context(product_context).browse(product_id) discount = 0