Button OpenERP 6.1-向导不应在单击按钮时关闭
您好,我在向导窗体上添加了一个按钮以打开另一个向导,但我不想关闭现有的向导,另一个向导的原因只是在用户筛选后传递一些值并选择少量数据 在我的向导窗体中,我添加了一个按钮,其中包含以下代码Button OpenERP 6.1-向导不应在单击按钮时关闭,button,popup,openerp,popupwindow,Button,Popup,Openerp,Popupwindow,您好,我在向导窗体上添加了一个按钮以打开另一个向导,但我不想关闭现有的向导,另一个向导的原因只是在用户筛选后传递一些值并选择少量数据 在我的向导窗体中,我添加了一个按钮,其中包含以下代码 > def action_process_pickings(self, cr, uid, ids, context=None): > if context is None: context = {} > context = dict(context, act
> def action_process_pickings(self, cr, uid, ids, context=None):
> if context is None: context = {}
> context = dict(context, active_ids=ids, active_model=self._name)
>
> return {
> 'name':_("Picking to Process"),
> 'view_mode': 'form',
> 'view_id': False,
> 'view_type': 'form',
> 'res_model': 'packing.wizard',
> 'res_id': ids[0],
> 'type': 'ir.actions.act_window',
> 'nodestroy': True,
> 'target': 'new',
> 'domain': '[]',
> 'context': context,
> }
我相信解决方案是将“nodestroy”设置为True,它在OpenERP 6.0和7.0上工作,但在6.1上不工作,有任何解决方案吗?从这里的内存开始,但如果您有按钮方法,则返回None而不是窗口操作,如果将记录警告,但保持窗口不变。非常确定这在6.1中是有效的来回答我自己的问题, 与其让现有窗口保持打开状态,不如从第二个弹出窗口返回第一个窗口作为窗口操作。这是我在6.1中找到的最好的方法 例如:
- 我有一个osv内存弹出模型a
- 我添加了一个按钮,打开另一个osv内存弹出窗口模型B
- 然后在模型B上,我将返回一些给模型A
def buttonB(self, cr, uid, ids, context=None):
if context is None: context = {}
self.pool.get('a').write(cr, uid, { [the value u want to update] })
return {
'name':_("Picking to Process"),
'view_mode': 'form',
'view_id': False,
'view_type': 'form',
'res_model': 'a,
'res_id': context.get('active_ids')[0],
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'domain': '[]',
'context': context,
}
def buttonB(self, cr, uid, ids, context=None):
if context is None: context = {}
self.pool.get('a').write(cr, uid, { [the value u want to update] })
return {
'name':_("Picking to Process"),
'view_mode': 'form',
'view_id': False,
'view_type': 'form',
'res_model': 'a,
'res_id': context.get('active_ids')[0],
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'domain': '[]',
'context': context,
}