From 96560c4db68256e49f3fd64fd605965d95090a14 Mon Sep 17 00:00:00 2001 From: "Anh Thao Pham (pta)" Date: Wed, 31 Jan 2024 11:11:54 +0000 Subject: [PATCH] [FIX] website_sale: fix prices on Products snippet on branch website Steps to reproduce: - Create a branch for a company (e.g. Branch X) - Go to "Website / Configuration / Websites" - Create or configure a website on Branch X (e.g. Website X) - Go to "Website / Configuration / Settings" - Select Website X - Set "Display Product Prices" to "Tax Included" - Create a product for a price of $100 and a tax from parent company (e.g. 15%) - Go Website X - Edit Home page and add Products snippet Issue: On the Products snippet, the price of the product should be "Tax Included" ($115), but it is not. The displayed price is $100. Cause: When computing the prices, taxes from parent companies are not taken into account. This fix is a complement to https://github.com/odoo/odoo/pull/151223 opw-3660156 closes odoo/odoo#152105 X-original-commit: ba6cb4f16fdbfa121e52f3c17c70e9783e8c2ea5 Signed-off-by: Antoine Vandevenne (anv) Signed-off-by: Anh Thao Pham (pta) --- addons/website_sale/models/product_product.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_sale/models/product_product.py b/addons/website_sale/models/product_product.py index 76c1dabe50a..7eec169b934 100644 --- a/addons/website_sale/models/product_product.py +++ b/addons/website_sale/models/product_product.py @@ -111,7 +111,7 @@ class Product(models.Model): price = self._get_contextual_price() website = self.env['website'].get_current_website() line_tax_type = website.show_line_subtotals_tax_selection - company_taxes = self.taxes_id.filtered(lambda tax: tax.company_id == self.env.company) + company_taxes = self.taxes_id.filtered(lambda tax: tax.company_id in self.env.company.parent_ids) if line_tax_type == "tax_included" and company_taxes: price = company_taxes.compute_all(price, product=self, partner=self.env['res.partner'])['total_included'] return price