Browse Source

Merge pull request #1259 from tarteo/11-matrix-use-widget-totals

[FIX] web_widget_x2many_2d_matrix: Use widget for formatting aggregates
pull/1272/merge
Pedro M. Baeza 6 years ago
committed by GitHub
parent
commit
c4a711004a
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      web_widget_x2many_2d_matrix/__manifest__.py
  2. 3
      web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js

2
web_widget_x2many_2d_matrix/__manifest__.py

@ -4,7 +4,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "2D matrix for x2many fields", "name": "2D matrix for x2many fields",
"version": "11.0.1.1.1",
"version": "11.0.1.1.2",
"author": "Therp BV, " "author": "Therp BV, "
"Tecnativa, " "Tecnativa, "
"Camptocamp, " "Camptocamp, "

3
web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js

@ -480,7 +480,8 @@ odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixRenderer', function (requ
*/ */
_apply_aggregate_value: function ($cell, aggregate) { _apply_aggregate_value: function ($cell, aggregate) {
var field = this.state.fields[aggregate.fname], var field = this.state.fields[aggregate.fname],
formatter = field_utils.format[field.type];
fieldInfo = this.state.fieldsInfo.list[aggregate.fname],
formatter = field_utils.format[fieldInfo.widget ? fieldInfo.widget : field.type];
var formattedValue = formatter( var formattedValue = formatter(
aggregate.value, field, {escape: true} aggregate.value, field, {escape: true}
); );

Loading…
Cancel
Save