I need run a wizard from python code or as a return of a python function. I need that when finish a production order skip automatically one wizard but does nothing, only print the wizard_id. Any idea? It's possible?
class mrp_production_workcenter_line(osv.osv):
_inherit = 'mrp.production.workcenter.line'
def show_wizard(self, cr, uid, ids):
qc_id = self.pool.get('mrp.production.workcenter.line').browse(cr,uid,ids[0]).qc_id.id
context={
'qc_id':qc_id,
'operation_id':ids[0]
}
wizard_id = self.pool.get("kms.qc.name.wiz").create(cr,uid,{}, context=dict(context, active_ids=ids))
print 'wizard_id : ', wizard_id
return {
'name':_("Quality Control"),
'view_mode': 'form',
'view_type': 'form',
'view_id': False,
#'model': 'kms.qc.name.wiz',
'res_model': 'kms.qc.name.wiz',
'res_id':wizard_id,
'type': 'ir.actions.act_window',
'nodestroy': True,
'target': 'new',
'domain': '[]',
'context': dict(context, active_ids=ids)
}
def action_done(self, cr, uid, ids):
""" Sets state to done, writes finish date and calculates delay.
@return: True
"""
super(mrp_production_workcenter_line,self).action_done(cr, uid, ids)
return self.show_wizard(cr,uid,ids)
mrp_production_workcenter_line()
Did you find the answer?