[MIG] website_sale_hide_all_prices: migrar a 19.0#460
Open
JrAdhoc wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates website_sale_hide_all_prices for Odoo v19 by adapting inherited QWeb xpaths and JS component customizations so prices/UI elements can be hidden consistently, and marks the module as installable again.
Changes:
- Updated multiple
website_saletemplate inheritances/xpaths to match v19 DOM/QWeb structure. - Refactored JS customizations to patch core components and rely on
session.website_hide_all_prices. - Bumped module version to 19.0 and set
installabletoTrue.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| website_sale_hide_all_prices/views/templates.xml | Updates inherited website_sale templates/xpaths and conditions for v19 markup. |
| website_sale_hide_all_prices/views/res_config_settings_views.xml | Moves the settings insertion point to a v19-specific location. |
| website_sale_hide_all_prices/static/src/components/product_configurator_dialog.js | Refactors configurator dialog customization to use session flag and sub-env. |
| website_sale_hide_all_prices/static/src/components/add_to_cart_notification.xml | Reworks add-to-cart notification template structure and nested cart lines. |
| website_sale_hide_all_prices/static/src/components/add_to_cart_notification.js | Switches from subclassing to patching and overrides the template. |
| website_sale_hide_all_prices/manifest.py | Bumps version to 19.0 and marks module installable. |
Comment on lines
1
to
4
| 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"; |
Comment on lines
1
to
+3
| 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"; |
Comment on lines
6
to
13
| 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, | ||
| }); | ||
| }, | ||
| }); |
Comment on lines
+5
to
+9
| patch(AddToCartNotification.prototype, { | ||
| get websiteHideAllPrices() { | ||
| return !!session.website_hide_all_prices; | ||
| }, | ||
| }); |
Comment on lines
+5
to
+11
| <div | ||
| class="d-flex flex-column gap-2 mb-2 mt-1" | ||
| t-foreach="mainLines" | ||
| t-as="line" | ||
| t-key="line.id" | ||
| > | ||
| <t t-call="website_sale_hide_all_prices.cartLine"/> |
Comment on lines
67
to
75
| <xpath expr="//a[@name='website_sale_main_button']" position="attributes"> | ||
| <attribute name="t-if">not website.website_hide_all_prices</attribute> | ||
| </xpath> | ||
| <xpath expr="//a[@name='website_sale_main_button']/t" position="after"> | ||
| <t t-if="website.website_hide_all_prices"> | ||
| <span>Request Quotation</span> | ||
| </t> | ||
| <xpath expr="//a[@name='website_sale_main_button']" position="after"> | ||
| <t t-if="website.website_hide_all_prices"> | ||
| <span class="btn btn-primary w-100">Request Quotation</span> | ||
| </t> | ||
| </xpath> | ||
| </template> |
Comment on lines
+3
to
6
| <template id="product_price" inherit_id="website_sale.product_price"> | ||
| <xpath expr="//div[@name='product_price']" position="attributes"> | ||
| <attribute name="t-if">not website.website_hide_all_prices</attribute> | ||
| </xpath> |
Comment on lines
34
to
38
| <template id="cart_lines" inherit_id="website_sale.cart_lines_price"> | ||
| <xpath expr="//h6[@name='website_sale_cart_line_price']" position="attributes"> | ||
| <attribute name="t-if">not website.website_hide_all_prices</attribute> | ||
| </xpath> | ||
| </template> |
Comment on lines
+41
to
45
| <template id="total" inherit_id="website_sale.total"> | ||
| <xpath expr="//div[contains(@t-attf-class, 'o_cart_total')]" position="attributes"> | ||
| <attribute name="t-if">not website.website_hide_all_prices and website_sale_order and website_sale_order.website_order_line</attribute> | ||
| </xpath> | ||
| </template> |
c5f539c to
f49ce6e
Compare
7118aa2 to
04ceb3d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Tarea
https://www.adhoc.inc/odoo/my-tasks/56559
Resumen
19.0.1.0.0y habilita el módulotemplates.xmlpor cambios estructurales de Odoo 19 enwebsite_saleres_config_settings(bloquesale_product_catalog_settingseliminado en v19)patch()correcto para Owl 2 (elimina mutación dethis.propsque es readonly)Xpaths corregidos
product_priceitemprop='offers'eliminadoname='product_price'productgroups='group_show_uom_price'eliminadohasclass('o_base_unit_price_wrapper')products_itemitemprop='offers'eliminadohasclass('product_price')suggested_products_listwebsite_sale_suggested_product_pricerenombradoh6[@name='suggested_product_price_container']cart_linescart_lines_price,div→h6inherit_id→cart_lines_pricetotalid='cart_total'eliminadot-ifendiv[contains(@t-attf-class, 'o_cart_total')]navigation_buttons<a>sin hijo<t>en v19t-ifen<a>+ sibling condicional