diff options
| author | Goffin Simon <sig@odoo.com> | 2019-11-27 09:34:38 +0000 |
|---|---|---|
| committer | Goffin Simon <sig@odoo.com> | 2019-11-28 10:10:16 +0000 |
| commit | c1c4404131bf2d2b913e6ef96106e1ef7754bcaa (patch) | |
| tree | c0ff18b9fb7216bf31ee93a45919bc4cb1228826 | |
| parent | b175558ce72f3f8f0badaa17613dbcbeb93f503c (diff) | |
[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#40981
X-original-commit: 40d3fa50e3d9a0e1cc0077cc8dcbe052ffa9820f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
| -rw-r--r-- | addons/website_sale/models/sale_order.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/website_sale/models/sale_order.py b/addons/website_sale/models/sale_order.py index 84bc296ac69..72e46666f35 100644 --- a/addons/website_sale/models/sale_order.py +++ b/addons/website_sale/models/sale_order.py @@ -253,7 +253,7 @@ class SaleOrder(models.Model): 'date': order.date_order, 'pricelist': order.pricelist_id.id, }) - product_with_context = self.env['product.product'].with_context(product_context) + product_with_context = self.env['product.product'].with_context(product_context).with_company(order.company_id.id) product = product_with_context.browse(product_id) values['price_unit'] = self.env['account.tax']._fix_tax_included_price_company( order_line._get_display_price(product), |
