Skip to content

[19.0][FIX] website_product_configurator: make test suite green on 19.0#1

Open
cliffkujala wants to merge 6 commits into
komit-consulting:19.0-mig-website_product_configuratorfrom
purekarting:19.0-pr176-contrib
Open

[19.0][FIX] website_product_configurator: make test suite green on 19.0#1
cliffkujala wants to merge 6 commits into
komit-consulting:19.0-mig-website_product_configuratorfrom
purekarting:19.0-pr176-contrib

Conversation

@cliffkujala

Copy link
Copy Markdown

Thanks for the migration! I tested website_product_configurator on 19.0 and the module installs and works, but the test suite needed a few Odoo-19 API fixups to pass. These commits sit on top of your branch so they flow straight into PR OCA#176.

All changes are test-only (no runtime module code is touched):

Summary

  • tests/common.py: product.product_category_5product.product_category_goods (the old xmlid was removed in 19.0).
  • tests/test_product_config.py / tests/test_sale_order.py: repair fixtures for 19.0 (partner xmlid, etc.).
  • tests/test_sale_order.py: rewrite the cart assertions for the new sale.order cart API (_cart_add / _cart_update_line_quantity), rename product_uomproduct_uom_id, and drop the removed pricelist discount_policy.
  • static/tests/tours/website_config_tour.esm.js: port the tour to the current web_tour API. Dependent <select> steps are scoped with :has(option:contains(...)) so each waits for the previous onchange RPC to render its options, and the navigating steps (including the final Continue, which redirects via window.location from the async save_configuration callback) are marked expectUnloadPage: true.

Test plan

  • test_01_admin_config_tour and test_02_demo_config_tour pass under --test-enable with demo data on 19.0.
  • The TransactionCase tests in tests/ pass.

Feel free to cherry-pick or squash into your [MIG] commit however you prefer.

product.product_category_5 no longer exists in Odoo 19. Reference
product.product_category_goods, which is always present (non-demo),
so the test setup works with and without demo data.
- base.res_partner_1 no longer exists; create a partner in setUpClass.
- test_remove_inactive_config_sessions passed a product.config.line id as
  product_tmpl_id, which violated the FK on Odoo 19; use a real
  product.template instead.
…olicy

The discount_policy field was removed from product.pricelist; passing it
on create raises ValueError on Odoo 19.
sale.order.line.product_uom was renamed to product_uom_id in Odoo 19.
sale.order._cart_update was removed in favour of _cart_add and
_cart_update_line_quantity. Rewrite the test to exercise the module's
overrides through the new API and assert the configuration session is
preserved across quantity updates and that a zero quantity removes the
line.
Port the website configurator tour to the Odoo 19 web_tour API so the
HttpCase tours (test_01_admin_config_tour / test_02_demo_config_tour)
run green:

- Replace the removed trigger/extra_trigger style with the current
  single-trigger steps and modern run helpers.
- Scope the dependent <select> steps with :has(option:contains(...))
  so each step waits for its options to be rendered after the previous
  onchange RPC, instead of racing it (avoids the empty-value select
  error).
- Mark the steps that navigate (search/select the product, and the
  final Continue) with expectUnloadPage: true. The final Continue
  submits the configuration (save_configuration, submit_configuration
  = true) and redirects via window.location from the RPC callback, so
  the unload fires asynchronously; keeping expectUnloadPage on the last
  step keeps allowUnload true and lets the tour finish on the
  configured product page.
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.

1 participant