summaryrefslogtreecommitdiff
path: root/addons/board/static/src
diff options
context:
space:
mode:
authorAaron Bohy <aab@odoo.com>2018-04-27 11:52:34 +0200
committerAaron Bohy <aab@odoo.com>2018-04-27 13:40:35 +0200
commit3628014abd31f8102b15685cdf2c47d4b761ba0e (patch)
tree1a7eb045477e6909521d0d36eab33aaf49bc334b /addons/board/static/src
parent25c5c62623c0735cf5ca2695c52a871b23a77633 (diff)
[FIX] board: action executed with option keepSearchView
Rev. 69c9500e recently added option 'keepSearchView' to doAction in the ActionManager. When set to true, the searchview of the current action is re-used by the executed action. This caused issues with the dashboard, as the wrong action id was used to save the current action to the dashboard (it was the one of the action for which the searchview was instantiated, not the one of the current action, executed with option keepSearchView set to true). For instance, go to Website (in enterprise), in the new dashboard (view) expand the graph view, try to add the graph action to the dashboard (board). Task 1835670.
Diffstat (limited to 'addons/board/static/src')
-rw-r--r--addons/board/static/src/js/favorite_menu.js6
1 files changed, 5 insertions, 1 deletions
diff --git a/addons/board/static/src/js/favorite_menu.js b/addons/board/static/src/js/favorite_menu.js
index 77cd3df4967..701ebef2801 100644
--- a/addons/board/static/src/js/favorite_menu.js
+++ b/addons/board/static/src/js/favorite_menu.js
@@ -71,6 +71,10 @@ FavoriteMenu.include({
var am = this.findAncestor(function (a) {
return a instanceof ActionManager;
});
+ // with options 'keepSearchView', it may happen that the action_id of
+ // the searchview (received in init) is not the one of the current
+ // action, which corresponds to the one we want to add to dashboard
+ var currentAction = am.getCurrentAction();
var controller = am.getCurrentController();
context.add(controller.widget.getContext());
var c = pyeval.eval('context', context);
@@ -86,7 +90,7 @@ FavoriteMenu.include({
return self._rpc({
route: '/board/add_to_dashboard',
params: {
- action_id: self.action_id || false,
+ action_id: currentAction.id || false,
context_to_save: c,
domain: domain,
view_mode: controller.viewType,