Skip to content
Permalink
Browse files

[FIX] web: add trick about the 160 limit in the search more view

  • Loading branch information...
fmdl committed Mar 23, 2019
1 parent aed56c9 commit c4ab10092a04234a79bd3b950d8fd63f56d088d4
@@ -565,7 +565,7 @@ var FieldMany2One = AbstractField.extend({
return new dialogs.SelectCreateDialog(this, _.extend({}, this.nodeOptions, {
res_model: this.field.relation,
domain: this.record.getDomain({fieldName: this.name}),
context: _.extend({}, this.record.getContext(this.recordParams), context || {}),
context: _.extend({}, this.record.getContext(this.recordParams), context || {}, {'search_default_limit_160':1}),
title: (view === 'search' ? _t("Search: ") : _t("Create: ")) + this.string,
initial_ids: ids ? _.map(ids, function (x) { return x[0]; }) : undefined,
initial_view: view,
@@ -792,6 +792,24 @@ var SearchView = Widget.extend({
category: category,
};
}

if (this.dataset.context.search_default_limit_160 === 1) {
filters.push({
"category": "filters",
"item": {
"attrs": {
"domain": [],
"isPeriod": false,
"name": "limit_160",
"string": _t("Remove this filter to see all result."),

},
"children:": [],
"tag": "filter"
}
});
}

var current_group = [],
current_category = 'filters',
categories = {filters: this.filters, group_by: this.groupbys, timeRanges: this.timeRanges};

0 comments on commit c4ab100

Please sign in to comment.
You can’t perform that action at this time.