OCA / web

Odoo web client UI related addons
GNU Affero General Public License v3.0
928 stars 1.88k forks source link

[BUG] - x2many_2d_matrix when using field_att_ attribute #1946

Open sbejaoui opened 3 years ago

sbejaoui commented 3 years ago

The x2many_2d_matrix widget had a useful feature to set an HTML attribute based on a boolean field. a common use case is to deactivate the input dynamically.

It works in v10 and seems to be unintentionally lost in the refactoring made with the v11 migration (https://github.com/OCA/web/commit/69cc921ab36e4dee42c68d749f3ce259bc5b5e5f)

Impacted versions:

Expected behavior:

<field nolabel="1" name="x2many_ids" widget="x2many_2d_matrix"
    field_x_axis="field_x_axis_id" 
    field_x_axis="field_y_axis_id" 
    field_value="field_value"
    field_att_disabled="disabled">
    <tree>

1

Current behavior:

Error message : TypeError: Cannot set property 'disabled' of undefined.

I will propose a MR to fix this later. But if someone want to do it here are the missing code blocks:

  1. https://github.com/OCA/web/blob/10.0/web_widget_x2many_2d_matrix/static/src/js/web_widget_x2many_2d_matrix.js#L38
  2. https://github.com/OCA/web/blob/10.0/web_widget_x2many_2d_matrix/static/src/js/web_widget_x2many_2d_matrix.js#L227

It will be nice to add this feature to the readme

rousseldenis commented 3 years ago

@hbrunn @Yajo @pedrobaeza @simahawk

github-actions[bot] commented 5 days ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.