From 74559098b4a1dcd6d0bf62549dd998f15cd4fd24 Mon Sep 17 00:00:00 2001 From: gaikaz Date: Wed, 17 Jun 2020 18:14:11 +0300 Subject: [PATCH] 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'` --- .../static/src/js/widget_x2many_2d_matrix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js b/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js index 3e7140704..9e94d17f2 100644 --- a/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js +++ b/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js @@ -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' : '') ); },