Skip to content

[MIG] website_sale_hide_all_prices: Migration to 20.0 - #528

Closed
ALopez-Adhoc wants to merge 10 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76641-loa
Closed

ALopez-Adhoc wants to merge 10 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76641-loa

Conversation

@ALopez-Adhoc

Copy link
Copy Markdown
Contributor

Tarea: https://www.adhoc.inc/odoo/project.task/76641

Migration of website_sale_hide_all_prices to 20.0.

Includes

  • The characterization tests from [ADD] website_sale_hide_all_prices: characterization tests #521 (19.0, not merged yet), cherry-picked so the migration runs against them. When the forward-port of [ADD] website_sale_hide_all_prices: characterization tests #521 reaches 20.0 it can be closed in favour of this PR.
  • depends: website_sale_comparison and website_sale_wishlist are gone in 20.0 (merged into website_sale), so only website_sale_ux stays.
  • API changes: checkout validation through website.checkout.step.validate_checkout_progress, _update_cart_taxes_and_prices, env.website, cart_has_blocking_alerts, hide_price in the comparison, ItemAddedNotification / CartNotificationLine for the cart notification, Owl 3 templates.
  • /shop/cart no longer fails with accessories or reference prices while prices are hidden (20.0 sets values inside the blocks the module hides).
  • Prices are also hidden in the search suggestions and in the new packaging selector of the product page.
  • README synced and Spanish translation exported and completed.

Behaviour to note

  • In 20.0 the checkout validation also checks stock and minimum quantities, so a quotation request with not enough stock goes back to the cart (in 19.0 it was sent anyway). Kept as 20.0 does for now; pending functional decision.

Tests

  • Local 20.0 database: 0 failed, 0 error(s) of 5 tests.

No data migration script needed: the module only stores website.website_hide_all_prices, which does not change.

Currently translated at 100.0% (14 of 14 strings)

Translation: website-19.0/website-19.0-website_sale_hide_all_prices
Translate-URL: https://translation.dev-adhoc.com/projects/website-19-0/website-19-0-website_sale_hide_all_prices/es/
(cherry picked from commit d5456c3)
@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

Cover how 'hide all prices' behaves in 19, with the setting on and off:
the payment mail is not sent, no shop page shows the product price (grid,
product page, comparison, cart, checkout and wishlist), the frontend
session gets the flag, and checkout ends in a quotation request instead
of a payment, also from the address form.

(cherry picked from commit 5fa506b)
- Depend only on website_sale_ux: website_sale_comparison and
  website_sale_wishlist were merged into website_sale, so the compare,
  wishlist and comparison row views now inherit the website_sale ones.
- Views: anchor on the new markup of the product page base unit price,
  the extra price badge, the dynamic products snippet price and the
  comparison table; combination_info['prevent_zero_price_sale'] is now
  'hide_price', and the main button uses cart_has_blocking_alerts since
  sale.order._is_cart_ready is gone.
- Controller: validate the cart and addresses with
  website.checkout.step.validate_checkout_progress (the controller
  _check_cart_and_addresses is gone), use env.website and
  _update_cart_taxes_and_prices, and answer the address form with a JSON
  response.
- JS: patch ItemAddedNotification and extend CartNotificationLine instead
  of replacing the add to cart notification template, and use this. in
  the inherited Owl templates.
- Tests: use session_store(), HttpCase.csrf_token() and the test user
  groups of the 20.0 test commons.
…idden prices

In 20.0 the suggested products and the cart line price blocks set
combination_info and product_price inside the block the module hides,
and use them right after it (base unit price). With prices hidden the
cart page failed with a KeyError or a TypeError. Move those t-set out of
the hidden block and hide the base unit price too. Keep the native
classes of the payment status block, new in 20.0.

The page test now has a product with an accessory and the reference
price enabled, which fails with a 500 on /shop/cart without the fix.
In 20.0 the search suggestions always show the product price (it moved
to search_item_metadata, which can no longer be turned off from the
editor), and the new packaging selector of the product page shows the
price per packaging. Use the native hooks to drop those prices when the
website hides all prices, and skip the packaging price on hover.

The page test now has a product with several packagings and checks the
search suggestions; both fail without this change.
@ALopez-Adhoc
ALopez-Adhoc marked this pull request as ready for review November 3, 2026 15:26
@augusto-weiss

Copy link
Copy Markdown
Contributor

@roboadhoc rebase-ff r+ nobump

@roboadhoc

Copy link
Copy Markdown
Contributor

Merge method set to rebase and fast-forward.

roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
Currently translated at 100.0% (14 of 14 strings)

Translation: website-19.0/website-19.0-website_sale_hide_all_prices
Translate-URL: https://translation.dev-adhoc.com/projects/website-19-0/website-19-0-website_sale_hide_all_prices/es/
(cherry picked from commit d5456c3)

Part-of: #528
Signed-off-by: Augusto Weiss <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
Cover how 'hide all prices' behaves in 19, with the setting on and off:
the payment mail is not sent, no shop page shows the product price (grid,
product page, comparison, cart, checkout and wishlist), the frontend
session gets the flag, and checkout ends in a quotation request instead
of a payment, also from the address form.

(cherry picked from commit 5fa506b)

Part-of: #528
Signed-off-by: Augusto Weiss <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
- Depend only on website_sale_ux: website_sale_comparison and
  website_sale_wishlist were merged into website_sale, so the compare,
  wishlist and comparison row views now inherit the website_sale ones.
- Views: anchor on the new markup of the product page base unit price,
  the extra price badge, the dynamic products snippet price and the
  comparison table; combination_info['prevent_zero_price_sale'] is now
  'hide_price', and the main button uses cart_has_blocking_alerts since
  sale.order._is_cart_ready is gone.
- Controller: validate the cart and addresses with
  website.checkout.step.validate_checkout_progress (the controller
  _check_cart_and_addresses is gone), use env.website and
  _update_cart_taxes_and_prices, and answer the address form with a JSON
  response.
- JS: patch ItemAddedNotification and extend CartNotificationLine instead
  of replacing the add to cart notification template, and use this. in
  the inherited Owl templates.
- Tests: use session_store(), HttpCase.csrf_token() and the test user
  groups of the 20.0 test commons.

Part-of: #528
Signed-off-by: Augusto Weiss <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
…idden prices

In 20.0 the suggested products and the cart line price blocks set
combination_info and product_price inside the block the module hides,
and use them right after it (base unit price). With prices hidden the
cart page failed with a KeyError or a TypeError. Move those t-set out of
the hidden block and hide the base unit price too. Keep the native
classes of the payment status block, new in 20.0.

The page test now has a product with an accessory and the reference
price enabled, which fails with a 500 on /shop/cart without the fix.

Part-of: #528
Signed-off-by: Augusto Weiss <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
In 20.0 the search suggestions always show the product price (it moved
to search_item_metadata, which can no longer be turned off from the
editor), and the new packaging selector of the product page shows the
price per packaging. Use the native hooks to drop those prices when the
website hides all prices, and skip the packaging price on hover.

The page test now has a product with several packagings and checks the
search suggestions; both fail without this change.

Part-of: #528
Signed-off-by: Augusto Weiss <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
@roboadhoc roboadhoc closed this in b2e1c9d Nov 3, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76641-loa branch November 3, 2026 20:10
@roboadhoc roboadhoc added the 19.1 label Nov 3, 2026

This branch was previously deployed

1 inactive deployment
merge — ed66a4b0 Deployed Nov 3, 2026 by roboadhoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants