mirror of
https://github.com/OCA/web.git
synced 2025-02-22 13:21:25 +02:00
web_widget_x2many_2d_matrix: Fix show_column_totals option
Commit a5e6acc3 introduced a bug, where show_column_totals="0" wouldn't work.
This is because JS ternary operator took node's attribute value as part of the condition.
As an example simplified JS code (before change):
`'0' || true ? '1' : ''` -> `'1'`
And this is what was probably meant originally (after change)
`'0' || (true ? '1' : '')` -> `'0'`
This commit is contained in:
@@ -68,11 +68,11 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
|
||||
}
|
||||
this.show_row_totals = this.parse_boolean(
|
||||
node.show_row_totals ||
|
||||
this.is_aggregatable(field_defs[this.field_value]) ? '1' : ''
|
||||
(this.is_aggregatable(field_defs[this.field_value]) ? '1' : '')
|
||||
);
|
||||
this.show_column_totals = this.parse_boolean(
|
||||
node.show_column_totals ||
|
||||
this.is_aggregatable(field_defs[this.field_value]) ? '1' : ''
|
||||
(this.is_aggregatable(field_defs[this.field_value]) ? '1' : '')
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user