From 84901af16bbfe387dc1597c33ecc01fe8240e81a Mon Sep 17 00:00:00 2001 From: "Eteil Djoumatchoua(etdj)" Date: Thu, 23 Mar 2023 10:57:42 +0000 Subject: [PATCH] [FIX] website_sale: Remove taxes of fixed comparison price MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps: - In the global settings: - Activate Comparison Price (group_product_price_comparison) - Put Line Subtotals Tax Display to “Tax Included” - Go to a product (e.g. Customizable Desk) - Set Compare to Price to a higher price than the sales price - Set a Customer Tax - Go to the shop on the website Issue: The crossed-out price is not the same in the product list page and in the product detail page. Cause: No condition of the application of the tax on base_price. Similar to: https://github.com/odoo/odoo/pull/113108/commits/8b7595deace98da26ee016ca565776ffd537284c opw-3199343 closes odoo/odoo#116821 X-original-commit: b58014d87d9e7b9520ec8aff35395ec3d921c36e Signed-off-by: Victor Feyens (vfe) Signed-off-by: Djoumatchoua Eteil Junior (etdj) --- addons/website_sale/models/product_template.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/addons/website_sale/models/product_template.py b/addons/website_sale/models/product_template.py index e196dc210d9..682e74cf7fc 100644 --- a/addons/website_sale/models/product_template.py +++ b/addons/website_sale/models/product_template.py @@ -203,10 +203,12 @@ class ProductTemplate(models.Model): base_price = base_sales_prices[template.id] if base_price and base_price != price_reduce: - base_price = self.env['account.tax']._fix_tax_included_price_company( - base_price, product_taxes, taxes, self.env.company) - base_price = taxes.compute_all(base_price, currency, 1, template, partner_sudo)[ - tax_display] + if not template.compare_list_price: + # Compare_list_price are never tax included + base_price = self.env['account.tax']._fix_tax_included_price_company( + base_price, product_taxes, taxes, self.env.company) + base_price = taxes.compute_all(base_price, currency, 1, template, partner_sudo)[ + tax_display] template_price_vals['base_price'] = base_price if base_price > price_reduce: base_price = self.env['account.tax']._fix_tax_included_price_company(