summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2014-11-20 14:58:10 +0100
committerGéry Debongnie <ged@odoo.com>2014-11-20 14:58:10 +0100
commit77413fc764e3c002b8c7e8d8498a136edbb8afa6 (patch)
treebee3a145d2d88628db556eec869035d1fafb6c72 /addons/web/static/src
parent5cd78b891b4baab60de5b55de88385ced11366ff (diff)
[FIX] update tests and change search logic (webclient)
previous commit broke some tests. The issue is that the search view now avoid making requests if there is no action id. But this is an assumption that tests use, so some slight adjustments have to be made. Also, this is the moment to give properly the action id to the favorite menu. Instead of bypassing its parent, it now receives the action id from the search view.
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/search.js10
-rw-r--r--addons/web/static/src/js/views.js1
2 files changed, 6 insertions, 5 deletions
diff --git a/addons/web/static/src/js/search.js b/addons/web/static/src/js/search.js
index c4627efc605..2859c30b3e5 100644
--- a/addons/web/static/src/js/search.js
+++ b/addons/web/static/src/js/search.js
@@ -387,7 +387,8 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.filter_menu = undefined;
this.groupby_menu = undefined;
- this.favorite_menu = undefined
+ this.favorite_menu = undefined;
+ this.action_id = this.options && this.options.action && this.options.action.id;
},
start: function() {
if (this.headless) {
@@ -423,7 +424,7 @@ instance.web.SearchView = instance.web.Widget.extend(/** @lends instance.web.Sea
this.groupby_menu = new my.GroupByMenu(this, this.groupbys, fields_def);
this.filter_menu = new my.FilterMenu(this, this.filters, fields_def);
- this.favorite_menu = new my.FavoriteMenu(this, this.query, this.dataset.model);
+ this.favorite_menu = new my.FavoriteMenu(this, this.query, this.dataset.model, this.action_id);
this.filter_menu.appendTo(this.$buttons);
this.groupby_menu.appendTo(this.$buttons);
@@ -1581,7 +1582,7 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
this.close_menus();
},
},
- init: function (parent, query, target_model) {
+ init: function (parent, query, target_model, action_id) {
this._super.apply(this,arguments);
this.searchview = parent;
this.query = query;
@@ -1589,8 +1590,7 @@ instance.web.search.FavoriteMenu = instance.web.Widget.extend({
this.model = new instance.web.Model('ir.filters');
this.filters = {};
this.$filters = {};
- var action = instance.client.action_manager.inner_action;
- this.action_id = action && action.id;
+ this.action_id = action_id;
},
start: function () {
var self = this;
diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js
index 1c41b043bf4..35c424ceb9f 100644
--- a/addons/web/static/src/js/views.js
+++ b/addons/web/static/src/js/views.js
@@ -786,6 +786,7 @@ instance.web.ViewManager = instance.web.Widget.extend({
hidden: this.flags.search_view === false,
disable_custom_filters: this.flags.search_disable_custom_filters,
$buttons: this.$('.oe-search-options'),
+ action: this.action,
};
var SearchView = instance.web.SearchView;
this.searchview = new SearchView(this, this.dataset, view_id, search_defaults, options);