odoo/odoo#230655

Created by fw-bot
Merged at 1b7b30a44580264e6e46ae40e6c3e5d9d292d973

Statuses:

label
odoo-dev:19.0-18.0-fix_sale_js_error_if_field_shown_before_product_id-lse-468874-fw
head
48a769f5c020f691ce903d86101c7be79f02f857
merged
8 months ago by Loan Sens (lse)
odoo/odoo
18.0 #228029
saas-18.2 #228535
saas-18.3 #230593
saas-18.4 #230629
19.0 #230655
saas-19.1
saas-19.2
saas-19.3
master #230677

[FIX] sale: prevent JS steps failing in case field shown before `product_id`

To reproduce:

  1. Manually modify the SO view view_order_form notebook SO lines list view to make visible any column before product_id For example:
    https://github.com/odoo/odoo/blob/18.0/addons/sale/views/sale_order_views.xml#L521 making the field display_type visible
  2. Run the tests of sale module

=> sale module tests will fail on test test_sale_combo_configurator_preconfigure_unconfigurable_ptals

FAILED: [18/22] Tour sale_combo_configurator_preconfigure_unconfigurable_ptals → Step Verify that configurable ptals are now configured (trigger:
        .sale-combo-configurator-dialog
        .combo-item-grid
        .product-card:has(.card-title:contains("Test product"))
    :contains("Attribute B: B")).
Element (
        .sale-combo-configurator-dialog
        .combo-item-grid
        .product-card:has(.card-title:contains("Test product"))
    :contains("Attribute B: B")) has not been found.
TIMEOUT step failed to complete within 10000 ms.

see runbot build fail at:
https://runbot.odoo.com/runbot/build/89552334

The issue happen as - for some dark magic JS/XML reason - adding the field before product_id make fail the step to click the checkbox using the span.

Fix was suggested by PIPU to solve/workaround the issue

In practice, this issue was discovered accidentally with a customisation which was willing to add a custom field at the start of the list

opw-5068699

Forward-Port-Of: #228029