In OpenERP when creating the wizard resource than the action of form is returned so agian we have to create the users and relate it to wizard resourse and also clicks the init icon in the web client than retrieve translated version of wizard's name.
Use this code given below
def selectioninit(self, cr, uid, context=None):
model_obj = self.pool.get('ir.model')
model_ids = model_obj.search(
cr, uid, [('model', '=', 'saved_selection.selection.init')],
context=context)
wizard_name =model_obj.read(
cr, uid, model_ids, ['name'], context=context)[0]['name']
# Create wizard resource
wizard_obj = self.pool.get('saved_selection.selection.init')
wizard_id = wizard_obj.create(cr, uid, {}, context)
# Compose and return action
return {
'name': wizard_name,
'views': [[False, 'form']],
'view_type': 'form',
'view_mode': 'form',
'res_model': 'saved_selection.selection.init',
'domain': [],
'context': context,
'type': 'ir.actions.act_window',
'target': 'new',
'res_id': wizard_id,
'nodestroy': True,
'nodestroy': True,
}
0 Comment(s)