~openerp-dev/openobject-client/trunk-bug-776961-aar

« back to all changes in this revision

Viewing changes to bin/widget/view/form_gtk/action.py

  • Committer: Amit Parmar (OpenERP)
  • Date: 2011-05-23 08:22:34 UTC
  • Revision ID: aar@tinyerp.com-20110523082234-5dirmg0zgteiavu0
[FIX] Dashboard : view_id provided in ir.actions.act_window.view is not taken into consideration

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
        interface.widget_interface.__init__(self, window, parent, model, attrs)
42
42
 
43
43
        self.act_id = int(attrs['name'])
44
 
        res = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.actions.actions', 'read', [self.act_id], ['type'], rpc.session.context)
45
 
        if not res:
 
44
        self.res = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.actions.actions', 'read', [self.act_id], ['type'], rpc.session.context)
 
45
        if not self.res:
46
46
            raise Exception, 'ActionNotFound'
47
 
        type = res[0]['type']
 
47
        type = self.res[0]['type']
 
48
        self.attrs = attrs
48
49
        self.action = rpc.session.rpc_exec_auth('/object', 'execute', type, 'read', [self.act_id], False, rpc.session.context)[0]
 
50
        
 
51
        
49
52
        if 'view_mode' in attrs:
50
53
            self.action['view_mode'] = attrs['view_mode']
51
54
 
81
84
        self.screen.switch_view()
82
85
 
83
86
    def _sig_search(self, *args):
84
 
        win = win_search(self.action['res_model'], domain=self.domain, context=self.context)
 
87
        for views in self.action['views']:
 
88
            if views[1] == 'tree' and views[0] != False:
 
89
                
 
90
                self.act_view = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.actions.act_window.view', 'search', [('act_window_id','=',self.res[0]['id']),('view_mode','=','tree')])
 
91
                
 
92
                self.act_view_id = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.actions.act_window.view', 'read', self.act_view,['view_id'],rpc.session.context)
 
93
               
 
94
                self.act_view_tree = rpc.session.rpc_exec_auth('/object', 'execute', 'ir.ui.view', 'search', [('name','=',self.act_view_id[0]['view_id'][1])])
 
95
              
 
96
            else:
 
97
                self.act_view_tree = []
 
98
        win = win_search(self.action['res_model'], view_ids = self.act_view_tree,domain=self.domain,context=self.context)
85
99
        res = win.go()
86
100
        if res:
87
101
            self.screen.clear()