[FIX] web_widget_x2many_2d_matrix: make the possibility to have alternative values for headers of rows and columns working

pull/2164/head
Sylvain LE GAL 2022-03-11 12:14:40 +01:00
parent b917c99d46
commit e9debedbd0
2 changed files with 5 additions and 3 deletions

View File

@ -220,7 +220,7 @@ odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixRenderer', function (requ
*/
_renderLabelCell: function (record) {
var $td = $('<td>');
var value = record.data[this.matrix_data.field_y_axis];
var value = record.data[this.matrix_data.field_label_y_axis];
if (value.type === 'record') {
// We have a related record
value = value.data.display_name;

View File

@ -94,8 +94,8 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
this.x_axis = [];
this.y_axis = [];
_.each(records, function (record) {
var x = record.data[this.field_x_axis],
y = record.data[this.field_y_axis];
var x = record.data[this.field_label_x_axis],
y = record.data[this.field_label_y_axis];
if (x.type === 'record') {
// We have a related record
x = x.data.display_name;
@ -126,6 +126,8 @@ odoo.define('web_widget_x2many_2d_matrix.widget', function (require) {
'field_value': this.field_value,
'field_x_axis': this.field_x_axis,
'field_y_axis': this.field_y_axis,
'field_label_x_axis': this.field_label_x_axis,
'field_label_y_axis': this.field_label_y_axis,
'columns': this.columns,
'rows': this.rows,
'show_row_totals': this.show_row_totals,