Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create wizard resource and return the action in OpenERP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 872
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: