Skip to content

Commit

Permalink
web_widget_x2many_matrix: fix issue with limit of records
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiBForgeFlow committed Aug 7, 2018
1 parent abd53c7 commit 74f2201
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
2 changes: 1 addition & 1 deletion web_widget_x2many_2d_matrix/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "2D matrix for x2many fields",
"version": "11.0.1.0.2",
"version": "11.0.1.0.3",
"author": "Therp BV, "
"Tecnativa, "
"Camptocamp, "
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
odoo.define('web_widget_x2many_2d_matrix.matrix_limit_extend', function (require) {
"use strict";

var AbstractView = require('web.AbstractView');

var AbstractViewCustom = AbstractView.include({

_setSubViewLimit: function (attrs) {
this._super(attrs);

var view = attrs.views && attrs.views[attrs.mode];
var limit = view && view.arch.attrs.limit && parseInt(view.arch.attrs.limit);
if (!limit && attrs.widget === 'x2many_2d_matrix') {
limit = Infinity;
attrs.limit = limit || 40;
}

}

});

return AbstractViewCustom;

});
1 change: 1 addition & 0 deletions web_widget_x2many_2d_matrix/views/assets.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<xpath expr="." position="inside">
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/2d_matrix_renderer.js" />
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/widget_x2many_2d_matrix.js" />
<script type="text/javascript" src="/web_widget_x2many_2d_matrix/static/src/js/abstract_view_matrix_limit_extend.js" />
<link rel="stylesheet" href="/web_widget_x2many_2d_matrix/static/src/css/web_widget_x2many_2d_matrix.css"/>
</xpath>
</template>
Expand Down

0 comments on commit 74f2201

Please sign in to comment.