[REF] web_kanban: allow a custom limit defined in the arch

With this commit, it's now possible to set an arbitrary limit on any
kanban view by adding a limit attribut to the root kanban tag in a
kanban definition.

Do not forward-port.

Backport of rev 8a87c382ba
This commit is contained in:
Simon Lejeune
2016-10-13 16:20:30 +02:00
parent 1f0a778742
commit 4450495e9e
@@ -66,7 +66,7 @@ var KanbanView = View.extend({
this.qweb.default_dict = _.clone(QWeb.default_dict);
this.model = this.dataset.model;
this.limit = options.limit || 40;
this.limit = options.limit;
this.grouped = undefined;
this.group_by_field = undefined;
this.default_group_by = undefined;
@@ -84,6 +84,10 @@ var KanbanView = View.extend({
},
view_loading: function(fvg) {
if (!this.limit) {
this.limit = parseInt(fvg.arch.attrs.limit, 10) || 40;
}
this.$el.addClass(fvg.arch.attrs.class);
this.fields_view = fvg;
this.default_group_by = fvg.arch.attrs.default_group_by;