[FIX] add the action's context to the search contexts as well

bzr revid: xmo@openerp.com-20110412072750-8338yfl549glz5wz
This commit is contained in:
Xavier Morel
2011-04-12 09:27:50 +02:00
parent 8fb463acae
commit ef9880931c
+18 -1
View File
@@ -115,7 +115,8 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
this.searchview = new openerp.base.SearchView(this, this.session, this.element_id + "_search", this.dataset, view_id, search_defaults);
this.searchview.on_search.add(function(domains, contexts, groupbys) {
self.views[self.active_view].controller.do_search.call(
self, domains.concat(self.domains()), contexts, groupbys);
self, domains.concat(self.domains()),
contexts.concat(self.contexts()), groupbys);
});
return this.searchview.start();
},
@@ -138,6 +139,14 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
*/
domains: function () {
return [];
},
/**
* Contexts added on searches by the view manager.
*
* @returns an empty list
*/
contexts: function () {
return [];
}
});
@@ -193,6 +202,14 @@ openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({
*/
domains: function () {
return [this.action.domain];
},
/**
* adds action context to the search contexts
*
* @returns the action's context
*/
contexts: function () {
return [this.action.context];
}
});