[ADD] Add menu_id in url state
bzr revid: fme@openerp.com-20121023122833-l9a520bkpe2yty2r
This commit is contained in:
parent
d8e3f1d46b
commit
f50c720f3e
|
@ -1128,6 +1128,7 @@ instance.web.WebClient = instance.web.Client.extend({
|
||||||
}
|
}
|
||||||
return $.when(self.action_manager.do_action(action, {
|
return $.when(self.action_manager.do_action(action, {
|
||||||
clear_breadcrumbs: true,
|
clear_breadcrumbs: true,
|
||||||
|
action_menu_id: self.menu.current_menu,
|
||||||
})).fail(function() {
|
})).fail(function() {
|
||||||
self.menu.open_menu(options.previous_menu_id);
|
self.menu.open_menu(options.previous_menu_id);
|
||||||
});
|
});
|
||||||
|
|
|
@ -174,6 +174,9 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
if(this.inner_action.type == 'ir.actions.act_window') {
|
if(this.inner_action.type == 'ir.actions.act_window') {
|
||||||
state['model'] = this.inner_action.res_model;
|
state['model'] = this.inner_action.res_model;
|
||||||
}
|
}
|
||||||
|
if (this.inner_action.menu_id) {
|
||||||
|
state['menu_id'] = this.inner_action.menu_id;
|
||||||
|
}
|
||||||
if (this.inner_action.id) {
|
if (this.inner_action.id) {
|
||||||
state['action'] = this.inner_action.id;
|
state['action'] = this.inner_action.id;
|
||||||
} else if (this.inner_action.type == 'ir.actions.client') {
|
} else if (this.inner_action.type == 'ir.actions.client') {
|
||||||
|
@ -241,6 +244,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
clear_breadcrumbs: false,
|
clear_breadcrumbs: false,
|
||||||
on_reverse_breadcrumb: function() {},
|
on_reverse_breadcrumb: function() {},
|
||||||
on_close: function() {},
|
on_close: function() {},
|
||||||
|
action_menu_id: null,
|
||||||
});
|
});
|
||||||
if (_.isString(action) && instance.web.client_actions.contains(action)) {
|
if (_.isString(action) && instance.web.client_actions.contains(action)) {
|
||||||
var action_client = { type: "ir.actions.client", tag: action };
|
var action_client = { type: "ir.actions.client", tag: action };
|
||||||
|
@ -266,6 +270,7 @@ instance.web.ActionManager = instance.web.Widget.extend({
|
||||||
pager : !popup && !inline,
|
pager : !popup && !inline,
|
||||||
display_title : !popup
|
display_title : !popup
|
||||||
}, action.flags || {});
|
}, action.flags || {});
|
||||||
|
action.menu_id = options.action_menu_id;
|
||||||
if (!(type in this)) {
|
if (!(type in this)) {
|
||||||
console.error("Action manager can't handle action of type " + action.type, action);
|
console.error("Action manager can't handle action of type " + action.type, action);
|
||||||
return $.Deferred().reject();
|
return $.Deferred().reject();
|
||||||
|
|
Loading…
Reference in New Issue