Skip to content

[MIG] website_sale_hide_all_prices: migrar a 19.0#460

Open
JrAdhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-56559-jr
Open

[MIG] website_sale_hide_all_prices: migrar a 19.0#460
JrAdhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-t-56559-jr

Conversation

@JrAdhoc

@JrAdhoc JrAdhoc commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Tarea

https://www.adhoc.inc/odoo/my-tasks/56559

Resumen

  • Actualiza versión a 19.0.1.0.0 y habilita el módulo
  • Corrige 7 xpaths rotos en templates.xml por cambios estructurales de Odoo 19 en website_sale
  • Actualiza inserción en res_config_settings (bloque sale_product_catalog_settings eliminado en v19)
  • Reescribe componentes OWL con el patrón patch() correcto para Owl 2 (elimina mutación de this.props que es readonly)

Xpaths corregidos

Template Problema Fix
product_price itemprop='offers' eliminado name='product_price'
product groups='group_show_uom_price' eliminado hasclass('o_base_unit_price_wrapper')
products_item itemprop='offers' eliminado hasclass('product_price')
suggested_products_list website_sale_suggested_product_price renombrado h6[@name='suggested_product_price_container']
cart_lines precio movido a template cart_lines_price, divh6 inherit_idcart_lines_price
total id='cart_total' eliminado t-if en div[contains(@t-attf-class, 'o_cart_total')]
navigation_buttons <a> sin hijo <t> en v19 t-if en <a> + sibling condicional

Copilot AI review requested due to automatic review settings June 8, 2026 19:51
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_sale template 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 installable to True.

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>
@JrAdhoc JrAdhoc force-pushed the 19.0-t-56559-jr branch 3 times, most recently from c5f539c to f49ce6e Compare June 8, 2026 20:19
@JrAdhoc JrAdhoc closed this Jun 9, 2026
@JrAdhoc JrAdhoc reopened this Jun 9, 2026
@JrAdhoc JrAdhoc force-pushed the 19.0-t-56559-jr branch 3 times, most recently from 7118aa2 to 04ceb3d Compare June 10, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants