web
web copied to clipboard
[BUG] - x2many_2d_matrix when using field_att_ attribute
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:
- 11.0+
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>
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:
- https://github.com/OCA/web/blob/10.0/web_widget_x2many_2d_matrix/static/src/js/web_widget_x2many_2d_matrix.js#L38
- 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