Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/google-maps/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Button OpenERP 6.1-向导不应在单击按钮时关闭_Button_Popup_Openerp_Popupwindow - Fatal编程技术网

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
A型shld上按钮的代码为:

def按钮(自身、cr、uid、ID、上下文=无): 如果上下文为None:context={} context=dict(context,active\u id=ids,active\u model=self.\u name)

然后,模型B上按钮的代码只是更新数据A,数据A应该是什么,然后使用windows操作返回模型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,
         }