~openerp-dev/openobject-client/trunk-win_installer_py2.6-rga

« back to all changes in this revision

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

  • Committer: Naresh(OpenERP)
  • Date: 2011-05-24 11:31:00 UTC
  • mfrom: (1894.1.1 trunk-bug-776961-nch)
  • Revision ID: nch@tinyerp.com-20110524113100-s79d1fql9w6lr5p3
[MERGE]: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:
48
48
        self.action = rpc.session.rpc_exec_auth('/object', 'execute', type, 'read', [self.act_id], False, rpc.session.context)[0]
49
49
        if 'view_mode' in attrs:
50
50
            self.action['view_mode'] = attrs['view_mode']
51
 
 
 
51
        self.action_view_ids = False
52
52
        if self.action['type'] == 'ir.actions.act_window':
53
53
            if not self.action.get('domain', False):
54
54
                self.action['domain'] = '[]'
60
60
            view_id = []
61
61
            if self.action['view_id']:
62
62
                view_id = [self.action['view_id'][0]]
 
63
            if self.action.get('views'):
 
64
                self.action_view_ids = map(lambda y:y[0], filter(lambda x:x[1] == 'tree',self.action['views']))
63
65
            if self.action['view_type']=='form':
64
66
                mode = (self.action['view_mode'] or 'form,tree').split(',')
65
67
                self.screen = Screen(self.action['res_model'], view_type=mode, context=self.context, view_ids = view_id, domain=self.domain)
81
83
        self.screen.switch_view()
82
84
 
83
85
    def _sig_search(self, *args):
84
 
        win = win_search(self.action['res_model'], domain=self.domain, context=self.context)
 
86
        win = win_search(self.action['res_model'], view_ids = self.action_view_ids, domain=self.domain, context=self.context)
85
87
        res = win.go()
86
88
        if res:
87
89
            self.screen.clear()
96
98
        return True
97
99
 
98
100
    def display(self, model, model_field):
99
 
        limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100)  or False  
 
101
        limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100)  or False
100
102
        res_id = rpc.session.rpc_exec_auth('/object', 'execute',
101
103
                self.action['res_model'], 'search', self.domain, 0,
102
104
                limit, False, self.context)