Hi, i want to know if a wizard can be invoked inside of a method, i.e, when a user press the save button on form, i do some checks and i want to invoke an osv_memory wizard in some determined conditions.
I found this code in the forums, but it doesn't works
Code:
def action_call_wizard(self,cr,uid,ids,context=None):
if context is None: context = {}
wizard_id = self.pool.get("your.osv.memory.wizard").create(
cr, uid, {}, context=dict(context, active_ids=ids))
return {
'name':_("name of wizard"),
'view_mode': 'form',
'view_id': False,
'view_type': 'form',
'res_model': 'your.osv.memory.wizard',
'res_id':wizard_id,
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'domain': '[]',
'context': dict(context, active_ids=ids)
}