在 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)
| 归档时间: |
|
| 查看次数: |
6219 次 |
| 最近记录: |