Use None as limit for xxx2Many and menu

The sort uses search_filter to retrieve the sorted ids list but this method use
the limit attribute of the screen. The xxx2Many values has no limit.

issue6363
review32161002
This commit is contained in:
Cédric Krier committed 2017-03-23 23:05:01 +01:00
1 parent 6ec37cd81f
commit 16f37bd281
3 files changed
+18 -7

No files matched your search

+2 -1
View File
@@ -398,7 +398,8 @@ var Sao = {};
'view_ids': view_ids,
'domain': domain,
'context': action_ctx,
'selection_mode': Sao.common.SELECTION_NONE
'selection_mode': Sao.common.SELECTION_NONE,
'limit': null
});
Sao.Tab.tabs.splice(Sao.Tab.tabs.indexOf(form), 1);
form.view_prm.done(function() {
+13 -5
View File
@@ -622,7 +622,6 @@
this.model_name = model_name;
this.model = new Sao.Model(model_name, attributes);
this.attributes = jQuery.extend({}, attributes);
this.attributes.limit = this.attributes.limit || Sao.config.limit;
this.view_ids = jQuery.extend([], attributes.view_ids);
this.view_to_load = jQuery.extend([],
attributes.mode || ['tree', 'form']);
@@ -635,7 +634,11 @@
this.current_record = null;
this.domain = attributes.domain || [];
this.size_limit = null;
this.limit = attributes.limit || Sao.config.limit;
if (this.attributes.limit === undefined) {
this.limit = Sao.config.limit;
} else {
this.limit = attributes.limit;
}
this.offset = 0;
this.order = this.default_order = attributes.order;
var access = Sao.common.MODELACCESS.get(model_name);
@@ -828,7 +831,8 @@
grp_prm.done(this.display.bind(this));
jQuery.when(grp_prm, count_prm).done(function(group, count) {
this.screen_container.but_next.prop('disabled',
!(group.length == this.limit &&
!(this.limit !== undefined &&
group.length == this.limit &&
count > this.limit + this.offset));
}.bind(this));
this.screen_container.but_prev.prop('disabled', this.offset <= 0);
@@ -1386,11 +1390,15 @@
});
},
search_prev: function(search_string) {
this.offset -= this.limit;
if (this.limit) {
this.offset -= this.limit;
}
this.search_filter(search_string);
},
search_next: function(search_string) {
this.offset += this.limit;
if (this.limit) {
this.offset += this.limit;
}
this.search_filter(search_string);
},
invalid_message: function(record) {
+3 -1
View File
@@ -2523,6 +2523,7 @@ function eval_pyson(value){
views_preload: attributes.views || {},
row_activate: this.activate.bind(this),
exclude_field: attributes.relation_field || null,
limit: null,
pre_validate: attributes.pre_validate
});
this.screen.pre_validate = attributes.pre_validate == 1;
@@ -2945,7 +2946,8 @@ function eval_pyson(value){
mode: ['tree'],
view_ids: (attributes.view_ids || '').split(','),
views_preload: attributes.views || {},
row_activate: this.activate.bind(this)
row_activate: this.activate.bind(this),
limit: null
});
this.prm = this.screen.switch_view('tree').done(function() {
this.content.append(this.screen.screen_container.el);