Skip to content

[MIG] website_sale_installment_plans: Migration to 20.0 - #523

Closed
augusto-weiss wants to merge 10 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76648-awe
Closed

augusto-weiss wants to merge 10 commits into
ingadhoc:20.0from
adhoc-dev:20.0-t-76648-awe

Conversation

@augusto-weiss

@augusto-weiss augusto-weiss commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

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

Migration of website_sale_installment_plans to 20.0, plus the improvements requested for the installment legend.

Migration:

  • Migrator: version 20.0.1.0.0, installable True. upgrade_code scripts of 19.x/20.0 and owl3-migration changed nothing. Font Awesome icons ported to Material Symbols.
  • website_sale.product_price no longer has div#product_unavailable (the module did not install): the legend now goes inside div[@name='product_price'], so it is hidden together with the price.
  • _get_combination_info follows the new signature (pricelist, fiscal_position); the override was then removed (see below).
  • prevent_zero_price_sale is gone in 20.0: hide_price / website.prevent_sale are used instead.

Improvements:

  • The legend is refreshed on variant change: /website_sale/get_combination_info returns it rendered, and a patch of ProductPage._onChangeCombination replaces it (same pattern as product_tags in core).
  • Amounts are formatted with the website currency (format_amount), as one translatable sentence, keeping the 19.0 text.
  • One sub-template for the product page and the shop grid, with Bootstrap classes instead of inline styles.
  • No legend when the price is zero or hidden.
  • Plans are searched once per request, only for active cards of the website company (its parent companies or no company), ordered by divisor. Cart, configurator and comparator no longer compute them.
  • map_installment_values keeps its override: payment_pay_way shows that description in the checkout.
  • depends: product removed (comes with website_sale). README completed and es translations exported.

Checked on a local 20.0 database: the module installs, its 5 tests pass, and /shop, the product page and get_combination_info render the legend with the variant price. Checked in the browser: changing the variant refreshes the installments without reloading the page.

No data migration script is needed: no stored field, selection or model changes. It was not tested on an upgraded database: runbot does not run the 19.0 → 20.0 upgrade yet.

@roboadhoc

Copy link
Copy Markdown
Contributor

Pull request status dashboard

@augusto-weiss augusto-weiss changed the title [WIP] [MIG] website_sale_installment_plans: Migration to 20.0 [MIG] website_sale_installment_plans: Migration to 20.0 Oct 29, 2026
@augusto-weiss

Copy link
Copy Markdown
Contributor Author

@roboadhoc rebase-ff

@roboadhoc

Copy link
Copy Markdown
Contributor

@augusto-weiss you can't rebase-ff.

- _get_combination_info: follow the new signature (pricelist,
  fiscal_position) and drop parent_combination.
- Product page: #product_unavailable no longer exists in
  website_sale.product_price; append the block inside the price
  container instead.
- t-esc -> t-out.
…e, currency and theme

- Product page: the legend is rendered inside the price container and is
  refreshed on variant change (get_combination_info returns it rendered,
  patched in ProductPage._onChangeCombination).
- Amounts use the monetary widget with the website currency.
- One sub-template for the product page and the shop grid, with
  Bootstrap classes instead of inline styles.
- No legend when the price is zero or hidden by prevent_sale.
- Published plans are searched once per HTTP request, only for active
  cards of the website company (or without company), ordered by divisor.
- Drop the _get_combination_info override, so cart, configurator and
  comparator no longer compute plans.
- Drop product from depends (comes with website_sale).

map_installment_values keeps its override: payment_pay_way shows that
description in the checkout installment selector.
…llow parent company cards

- The legend is built as one translatable sentence (format_amount for
  the amounts), so translations keep their word order, and the plural
  form still follows divisor, as in 19.0.
- Cards of a parent company are shown in the websites of its branches.
- The per-request cache is bound to the cursor, since read-only
  requests can be retried on a new one.
…ol in tests

The legend is formatted with the website currency, which is not $ in
every database (runbot shows USD).
…checkout, and route tests

map_installment_values builds the description with format_amount and takes
an optional currency (the card company one by default), so the Payway
checkout shows the same text as the shop. The shop passes the website
currency and reuses that description.

Add HttpCase tests for the combination info route and for the per-request
cache of the published plans.
@ALopez-Adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ nobump rebase-ff

@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
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
- _get_combination_info: follow the new signature (pricelist,
  fiscal_position) and drop parent_combination.
- Product page: #product_unavailable no longer exists in
  website_sale.product_price; append the block inside the price
  container instead.
- t-esc -> t-out.

Part-of: #523
Signed-off-by: Alexis Lopez <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
…e, currency and theme

- Product page: the legend is rendered inside the price container and is
  refreshed on variant change (get_combination_info returns it rendered,
  patched in ProductPage._onChangeCombination).
- Amounts use the monetary widget with the website currency.
- One sub-template for the product page and the shop grid, with
  Bootstrap classes instead of inline styles.
- No legend when the price is zero or hidden by prevent_sale.
- Published plans are searched once per HTTP request, only for active
  cards of the website company (or without company), ordered by divisor.
- Drop the _get_combination_info override, so cart, configurator and
  comparator no longer compute plans.
- Drop product from depends (comes with website_sale).

map_installment_values keeps its override: payment_pay_way shows that
description in the checkout installment selector.

Part-of: #523
Signed-off-by: Alexis Lopez <[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
…nslations for 20.0

Part-of: #523
Signed-off-by: Alexis Lopez <[email protected]>
roboadhoc pushed a commit that referenced this pull request Nov 3, 2026
…llow parent company cards

- The legend is built as one translatable sentence (format_amount for
  the amounts), so translations keep their word order, and the plural
  form still follows divisor, as in 19.0.
- Cards of a parent company are shown in the websites of its branches.
- The per-request cache is bound to the cursor, since read-only
  requests can be retried on a new one.

Part-of: #523
Signed-off-by: Alexis Lopez <[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
…ol in tests

The legend is formatted with the website currency, which is not $ in
every database (runbot shows USD).

Part-of: #523
Signed-off-by: Alexis Lopez <[email protected]>
@roboadhoc roboadhoc closed this in a9e0384 Nov 3, 2026
@roboadhoc
roboadhoc deleted the 20.0-t-76648-awe branch November 3, 2026 16:14
@roboadhoc roboadhoc added the 19.1 label Nov 3, 2026

This branch was previously deployed

1 inactive deployment
merge — 71f9851f 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.

3 participants