~fabien-morin/unifield-web/fm-us-3366

« back to all changes in this revision

Viewing changes to addons/openerp/widgets/form/_action.py

  • Committer: jf
  • Date: 2017-05-18 09:55:05 UTC
  • mfrom: (4842.3.5 unifield-web)
  • Revision ID: jfb@tempo-consulting.fr-20170518095505-as0f6t5pzap6edpo
US-2704 [IMP] Finance Dashbord: new attribute target_action_id on dashbord top open specific views

lp:~fabien-morin/unifield-web/fm-us-2704

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
        self.nolabel = True
40
40
 
41
41
        self.act_id= self.name
42
 
        
 
42
        self.target_action_id = attrs.get('target_action_id') and int(attrs.get('target_action_id')) or False
 
43
 
43
44
        proxy = rpc.RPCProxy("ir.actions.actions")
44
45
        res = proxy.read([self.act_id], ['type'], rpc.session.context)
45
46
        if not res:
47
48
 
48
49
        _type=res[0]['type']
49
50
        self.action = rpc.session.execute('object', 'execute', _type, 'read',
50
 
                [self.act_id], ['view_mode', 'type', 'domain', 'context',
51
 
                    'views', 'view_type', 'res_model'], rpc.session.context)[0]
 
51
                                          [self.act_id], ['view_mode', 'type', 'domain', 'context',
 
52
                                                          'views', 'view_type', 'res_model'], rpc.session.context)[0]
52
53
 
53
54
        if 'view_mode' in attrs:
54
55
            self.action['view_mode'] = attrs['view_mode']
80
81
                    id=False,
81
82
                    ids=None,
82
83
                    view_ids=view_ids,
 
84
                    target_action_id=self.target_action_id,
83
85
                    view_mode=view_mode,
84
86
                    context=self.context,
85
87
                    domain=self.domain,