[FIX] website_sale: Remove taxes of fixed comparison price

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) <vfe@odoo.com>
Signed-off-by: Djoumatchoua Eteil Junior (etdj) <etdj@odoo.com>
This commit is contained in:
Eteil Djoumatchoua(etdj)
2023-03-29 09:33:44 +02:00
parent a7ed23a41c
commit 84901af16b
@@ -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(