如何将当前值传递给odoo中的向导

Moh*_*sof 0 openerp

单击按钮时,我打开了一些向导,此向导在主模型的子模型中插入了一些值,因此我需要将一些数据从主模型发送到向导

数据包括当前 ID

Moh*_*sof 5

在 python 代码中找到了一个解决方案,我使用了这样的函数

@api.multi
    def open_wizard(self):
        return {
            'view_type': 'form',
            'view_mode': 'form',
            'res_model': 'model_name',
            'target': 'new',
            'type': 'ir.actions.act_window',
            'context': {'current_id': self.id}
        } 
Run Code Online (Sandbox Code Playgroud)

在向导中我可以像这样使用这个“current_id”

print self._context['current_id']
Run Code Online (Sandbox Code Playgroud)