web_widget_x2many_matrix: fix issue with limit of records

This commit is contained in:
Jordi Ballester Alomar
2018-08-07 18:18:37 +02:00
parent 6f8415c4e2
commit f230ffcfe7
4 changed files with 20 additions and 2 deletions

View File

@@ -319,7 +319,7 @@ odoo.define('web_widget_x2many_2d_matrix.X2Many2dMatrixRenderer', function (requ
* @private
* @returns {jQueryElement} The td element with the total in it.
*/
_renderTotalCell: function() {
_renderTotalCell: function () {
if (!this.matrix_data.show_column_totals ||
!this.matrix_data.show_row_totals) {
return;

View File

@@ -0,0 +1,17 @@
odoo.define( "web_widget_x2many_2d_matrix.matrix_limit_extend", function (require) {
"use strict";
var AbstractView = require("web.AbstractView");
AbstractView.include({
// We extend this method so that the view is not limited to
// just 40 cells when the 'x2many_2d_matrix' widget is used.
_setSubViewLimit: function (attrs) {
this._super(attrs);
if (attrs.widget === "x2many_2d_matrix") {
attrs.limit = Infinity;
}
},
};
}
);