From 5f0597b7059b9ae2fba5c49b6f3e5d2bbfa2fabe Mon Sep 17 00:00:00 2001 From: Juan Rivero Date: Tue, 30 Jun 2026 14:20:22 +0000 Subject: [PATCH] [IMP] l10n_ar_website_sale_ux: refresh tax-excluded price on variant change The tax-excluded price (RG 4/2025) was rendered server-side but stayed stale when the customer switched variant on the product page. Extend the website_sale VariantMixin to update it on combination change, mirroring how the regular price is refreshed. X-original-commit: 712d84a584e51903f7425570ff864e529dc2c690 --- l10n_ar_website_sale_ux/__manifest__.py | 11 +++ .../static/src/js/website_sale.js | 25 +++++++ .../views/l10n_ar_website_sale_ux.xml | 72 +++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 l10n_ar_website_sale_ux/static/src/js/website_sale.js diff --git a/l10n_ar_website_sale_ux/__manifest__.py b/l10n_ar_website_sale_ux/__manifest__.py index 29db3c13..17e7b708 100644 --- a/l10n_ar_website_sale_ux/__manifest__.py +++ b/l10n_ar_website_sale_ux/__manifest__.py @@ -20,7 +20,13 @@ { "name": "l10n_ar Website Sale UX", "category": "Website/Website", +<<<<<<< adea8fc13ac32cf512c03951637c6ef20464f387 "version": "19.0.1.3.0", +||||||| d63accf839d62fc33df48d90ea7ad0496afdf66a + "version": "18.0.1.3.0", +======= + "version": "18.0.1.4.0", +>>>>>>> da53ab1a630caf6f21fc9434e34190be094fad0d "author": "ADHOC SA", "website": "www.adhoc.com.ar", "license": "AGPL-3", @@ -33,6 +39,11 @@ "views/l10n_ar_website_sale_hide_taxes.xml", "views/portal_address_templates.xml", ], + "assets": { + "web.assets_frontend": [ + "l10n_ar_website_sale_ux/static/src/js/website_sale.js", + ], + }, "installable": True, "auto_install": ["l10n_ar_website_sale"], } diff --git a/l10n_ar_website_sale_ux/static/src/js/website_sale.js b/l10n_ar_website_sale_ux/static/src/js/website_sale.js new file mode 100644 index 00000000..884f0289 --- /dev/null +++ b/l10n_ar_website_sale_ux/static/src/js/website_sale.js @@ -0,0 +1,25 @@ +/** @odoo-module **/ + +import publicWidget from "@web/legacy/js/public/public_widget"; +import "@website_sale/js/website_sale"; + +/* + * RG 4/2025 forces us to show both prices (with and without national taxes) in + * the e-commerce. The tax-excluded price is rendered server-side, but it must + * also be refreshed when the customer picks another variant on the product + * page, mirroring how Odoo updates the regular price on combination change. + * + * We include the WebsiteSale widget (not the VariantMixin) because the widget + * copies the mixin methods into its prototype at definition time, so patching + * the mixin afterwards from this asset would never reach the widget instance. + */ +publicWidget.registry.WebsiteSale.include({ + _onChangeCombination(ev, $parent, combination) { + this._super.apply(this, arguments); + if (combination.price_tax_excluded !== undefined) { + $parent.find(".o_l10n_ar_price_tax_excluded .oe_currency_value").text( + this._priceToStr(combination.price_tax_excluded, combination.currency_precision) + ); + } + }, +}); diff --git a/l10n_ar_website_sale_ux/views/l10n_ar_website_sale_ux.xml b/l10n_ar_website_sale_ux/views/l10n_ar_website_sale_ux.xml index 085b4ac8..7c0c8d18 100644 --- a/l10n_ar_website_sale_ux/views/l10n_ar_website_sale_ux.xml +++ b/l10n_ar_website_sale_ux/views/l10n_ar_website_sale_ux.xml @@ -1,5 +1,6 @@ +<<<<<<< adea8fc13ac32cf512c03951637c6ef20464f387