[FIX] action where res_id is defined
bzr revid: al@openerp.com-20110811145904-0on11bcatcvg8r3q
This commit is contained in:
@@ -176,7 +176,6 @@ openerp.base.TreeView = openerp.base.View.extend({
|
||||
}, function (actions) {
|
||||
if (!actions.length) { return; }
|
||||
var action = actions[0][2];
|
||||
action.flags.new_window = true;
|
||||
self.do_action(action);
|
||||
});
|
||||
},
|
||||
|
||||
@@ -39,7 +39,6 @@ openerp.base.ActionManager = openerp.base.Widget.extend({
|
||||
var type = action.type.replace(/\./g,'_');
|
||||
var popup = action.target === 'new';
|
||||
action.flags = _.extend({
|
||||
popup: popup,
|
||||
views_switcher : !popup,
|
||||
search_view : !popup,
|
||||
action_buttons : !popup,
|
||||
@@ -53,7 +52,7 @@ openerp.base.ActionManager = openerp.base.Widget.extend({
|
||||
this[type](action, on_close);
|
||||
},
|
||||
ir_actions_act_window: function (action, on_close) {
|
||||
if (action.flags.popup) {
|
||||
if (action.target === 'new') {
|
||||
if (this.dialog == null) {
|
||||
this.dialog = new openerp.base.Dialog(this, { title: action.name, width: '80%' });
|
||||
if(on_close)
|
||||
@@ -252,13 +251,15 @@ openerp.base.ViewManager = openerp.base.Widget.extend({
|
||||
openerp.base.ViewManagerAction = openerp.base.ViewManager.extend({
|
||||
init: function(parent, action) {
|
||||
this.session = parent.session;
|
||||
this.action = action;
|
||||
var dataset;
|
||||
if (!action.res_id) {
|
||||
dataset = new openerp.base.DataSetSearch(this, action.res_model, action.context, action.domain);
|
||||
} else {
|
||||
this.action.flags.search_view = false;
|
||||
dataset = new openerp.base.DataSetStatic(this, action.res_model, action.context, [action.res_id]);
|
||||
dataset.index = 0;
|
||||
}
|
||||
this.action = action;
|
||||
this._super(parent, dataset, action.views);
|
||||
this.action = action;
|
||||
this.flags = this.action.flags || {};
|
||||
|
||||
Reference in New Issue
Block a user