From c752721c1c0a13a56699004217a47160c96cd423 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJuan?= Date: Tue, 9 Jun 2026 15:05:32 +0000 Subject: [PATCH] [MIG] website_sale_hide_all_prices: migrar a 19.0 --- website_sale_hide_all_prices/README.rst | 2 +- website_sale_hide_all_prices/__manifest__.py | 4 +- .../components/add_to_cart_notification.js | 20 ++---- .../components/add_to_cart_notification.xml | 68 ++++++++++++++---- .../components/product_configurator_dialog.js | 12 ++-- .../views/res_config_settings_views.xml | 4 +- .../views/templates.xml | 70 ++++++++++++------- 7 files changed, 115 insertions(+), 65 deletions(-) diff --git a/website_sale_hide_all_prices/README.rst b/website_sale_hide_all_prices/README.rst index f8590551..131459b4 100644 --- a/website_sale_hide_all_prices/README.rst +++ b/website_sale_hide_all_prices/README.rst @@ -35,7 +35,7 @@ Usage To use this module, you need to: -#. Just use the module. +#. Just use the module.. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot diff --git a/website_sale_hide_all_prices/__manifest__.py b/website_sale_hide_all_prices/__manifest__.py index ec461cdf..7f4cfc41 100644 --- a/website_sale_hide_all_prices/__manifest__.py +++ b/website_sale_hide_all_prices/__manifest__.py @@ -20,7 +20,7 @@ { "name": "Website Sale Hide All Prices", "category": "website", - "version": "18.0.2.0.0", + "version": "19.0.1.0.0", "author": "ADHOC SA", "website": "www.adhoc.com.ar", "license": "AGPL-3", @@ -37,5 +37,5 @@ "website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js", ] }, - "installable": False, + "installable": True, } diff --git a/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.js b/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.js index ab8c27a9..034c18bd 100644 --- a/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.js +++ b/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.js @@ -1,17 +1,11 @@ -/** @odoo-module **/ - import { session } from "@web/session"; import { AddToCartNotification } from "@website_sale/js/notification/add_to_cart_notification/add_to_cart_notification"; -import { CartNotification } from "@website_sale/js/notification/cart_notification/cart_notification"; -import { WarningNotification } from "@website_sale/js/notification/warning_notification/warning_notification"; - -class MyAddToCartNotification extends AddToCartNotification { - setup(){ - super.setup(); - this.props['website_hide_all_prices'] = session['website_hide_all_prices'] - } -} +import { patch } from "@web/core/utils/patch"; -CartNotification.components = { AddToCartNotification: MyAddToCartNotification , WarningNotification } +patch(AddToCartNotification.prototype, { + get websiteHideAllPrices() { + return !!session.website_hide_all_prices; + }, +}); -MyAddToCartNotification.template = 'website_sale_hide_all_prices.MyAddToCartNotification' +AddToCartNotification.template = "website_sale_hide_all_prices.MyAddToCartNotification"; diff --git a/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.xml b/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.xml index 32b99683..827fc74b 100644 --- a/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.xml +++ b/website_sale_hide_all_prices/static/src/components/add_to_cart_notification.xml @@ -1,23 +1,61 @@ - -
-
- -
-
- - -
-
+ + +
+
View cart
+ + +
+
+
+ +
+ +
+
+ + + + +
+
+
+
+ + + +
+ + diff --git a/website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js b/website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js index 9a7cbd7d..8af672b3 100644 --- a/website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js +++ b/website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js @@ -1,17 +1,13 @@ -/** @odoo-module **/ - import { useSubEnv } from "@odoo/owl"; -import { ProductConfiguratorDialog } from '@sale/js/product_configurator_dialog/product_configurator_dialog'; -import { patch } from '@web/core/utils/patch'; +import { ProductConfiguratorDialog } from "@sale/js/product_configurator_dialog/product_configurator_dialog"; +import { patch } from "@web/core/utils/patch"; import { session } from "@web/session"; patch(ProductConfiguratorDialog.prototype, { - setup() { + setup() { super.setup(...arguments); - this.props['website_hide_all_prices'] = session['website_hide_all_prices'] - useSubEnv({ - showPrice: !this.props.website_hide_all_prices ?? true, + showPrice: !session.website_hide_all_prices, }); }, }); diff --git a/website_sale_hide_all_prices/views/res_config_settings_views.xml b/website_sale_hide_all_prices/views/res_config_settings_views.xml index 6d9c41cf..7e68519c 100644 --- a/website_sale_hide_all_prices/views/res_config_settings_views.xml +++ b/website_sale_hide_all_prices/views/res_config_settings_views.xml @@ -3,9 +3,9 @@ res.config.settings.view.form.inherit.website.sale res.config.settings - + - + diff --git a/website_sale_hide_all_prices/views/templates.xml b/website_sale_hide_all_prices/views/templates.xml index 647f2776..d4c06527 100644 --- a/website_sale_hide_all_prices/views/templates.xml +++ b/website_sale_hide_all_prices/views/templates.xml @@ -1,66 +1,86 @@ -