Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How user clicks the selection's icon in the web client in OpenERP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 253
    Comment on it

    In OpenERP for clicking the selection's icon in the web client, first create the users and check all rights of the users and than click the selection icon in web client and compose a default action for the model in the user's selection, and apply the domain of the user's selection and Return the action that contains all of this in the web client.

    Use this function show in given below

    def actionget(self, cr, uid, context=None):
     
            if context is None:
                context = {}
            res = False
    
            selection_id = False
            me = self.pool.get('res.users').read(
                cr, uid, uid, ['saved_selection_id'], context=context)
            if me['saved_selection_id']:
                selection_id = me['saved_selection_id'][0]
                selection = self.read(
                    cr, uid, selection_id, ['model_id', 'ids', 'name'], context)
                model = self.pool.get('ir.model').read(
                    cr, uid, selection['model_id'][0], ['model'], context
                    )['model']
                context['active_id'] = False
                context['active_ids'] = False
                context['active_model'] = model
                res = {
                    'domain': [('id', 'in',
                                selection['ids'] and
                                [int(x) for x in selection['ids'].split(',')] or []
                                )],
                    'name': (_('Saved Selection') + 
                             (selection['name'] and (' %s' % selection['name']) or '') +
                             ' (' + selection['model_id'][1] + ')'),
                    'res_model': model,
                    'views': [(False, view_type) for view_type in 
                              ('list', 'page', 'form')],
                    'type': 'ir.actions.act_window',
                    'target': 'current',
                    'limit': 80,
                    'auto_search': True,
                    'is_saved_selection': True,
                    }
            return res
    

     

 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: