summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/search_panel.js
diff options
context:
space:
mode:
authorwan <wan@odoo.com>2019-08-28 13:54:41 +0000
committerwan <wan@odoo.com>2019-09-04 09:00:03 +0000
commit737eaf93330b7c4e5ff16311c92f1ad17be0cf72 (patch)
tree6f2520e675791f3af0cdd84252bab393b3a62717 /addons/web/static/src/js/views/search_panel.js
parent16c32f0c25f82b308b50e55e2127a2e6d139f7bf (diff)
[IMP] account: add searchpanel on account.account and account.move.line
Task 2008956 * Add the root of an account (first 2 digits/char) as a searchable model. * Create a custom searchpanel for this account root on account.move.line * Add the account_root searchpanel to the account.account view too.
Diffstat (limited to 'addons/web/static/src/js/views/search_panel.js')
-rw-r--r--addons/web/static/src/js/views/search_panel.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/search_panel.js b/addons/web/static/src/js/views/search_panel.js
index f09ef071f79..32bfda12594 100644
--- a/addons/web/static/src/js/views/search_panel.js
+++ b/addons/web/static/src/js/views/search_panel.js
@@ -99,6 +99,7 @@ var SearchPanel = Widget.extend({
this.defaultValues = params.defaultValues || {};
this.fields = params.fields;
this.model = params.model;
+ this.className = params.classes.concat(['o_search_panel']).join(' ');
this.searchDomain = params.searchDomain;
},
/**
@@ -157,6 +158,7 @@ var SearchPanel = Widget.extend({
*/
computeSearchPanelParams: function (viewInfo, viewType) {
var searchPanelSections;
+ var classes;
if (viewInfo) {
var arch = viewUtils.parseArch(viewInfo.arch);
viewType = viewType === 'list' ? 'tree' : viewType;
@@ -167,13 +169,19 @@ var SearchPanel = Widget.extend({
if (attrs.view_types) {
viewTypes = attrs.view_types.split(',');
}
+ if (attrs.class) {
+ classes = attrs.class.split(' ');
+ }
if (viewTypes.indexOf(viewType) !== -1) {
searchPanelSections = _processSearchPanelNode(node, viewInfo.fields);
}
}
});
}
- return searchPanelSections;
+ return {
+ sections: searchPanelSections,
+ classes: classes,
+ }
},
/**
* Export the current state (categories and filters) of the searchpanel.