Merge lp:~openerp-dev/openobject-client/trunk-bug-776961-nch into lp:openobject-client

Proposed by Naresh(OpenERP)
Status: Merged
Merged at revision: 1895
Proposed branch: lp:~openerp-dev/openobject-client/trunk-bug-776961-nch
Merge into: lp:openobject-client
Diff against target: 61 lines (+7/-5)
2 files modified
bin/modules/gui/window/win_search.py (+2/-2)
bin/widget/view/form_gtk/action.py (+5/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-client/trunk-bug-776961-nch
Reviewer Review Type Date Requested Status
Naresh(OpenERP) Pending
Review via email: mp+62107@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/modules/gui/window/win_search.py'
2--- bin/modules/gui/window/win_search.py 2011-02-14 12:04:15 +0000
3+++ bin/modules/gui/window/win_search.py 2011-05-24 11:27:29 +0000
4@@ -107,7 +107,7 @@
5
6
7 class win_search(object):
8- def __init__(self, model, sel_multi=True, ids=[], context={}, domain = [], parent=None):
9+ def __init__(self, model, sel_multi=True, ids=[], view_ids=False, context={}, domain = [], parent=None):
10 self.model = model
11 self.sel_multi = sel_multi
12 self.ids = ids
13@@ -118,7 +118,7 @@
14 parent = service.LocalService('gui.main').window
15 self.parent = parent
16 self.win.set_transient_for(parent)
17- self.screen = Screen(model, view_type=['tree'], show_search=True, domain=domain,
18+ self.screen = Screen(model, view_type=['tree'], view_ids=view_ids, show_search=True, domain=domain,
19 context=context, parent=self.win, win_search=True)
20 self.view = self.screen.current_view
21 if self.screen.filter_widget.focusable:
22
23=== modified file 'bin/widget/view/form_gtk/action.py'
24--- bin/widget/view/form_gtk/action.py 2011-05-06 10:52:28 +0000
25+++ bin/widget/view/form_gtk/action.py 2011-05-24 11:27:29 +0000
26@@ -48,7 +48,7 @@
27 self.action = rpc.session.rpc_exec_auth('/object', 'execute', type, 'read', [self.act_id], False, rpc.session.context)[0]
28 if 'view_mode' in attrs:
29 self.action['view_mode'] = attrs['view_mode']
30-
31+ self.action_view_ids = False
32 if self.action['type'] == 'ir.actions.act_window':
33 if not self.action.get('domain', False):
34 self.action['domain'] = '[]'
35@@ -60,6 +60,8 @@
36 view_id = []
37 if self.action['view_id']:
38 view_id = [self.action['view_id'][0]]
39+ if self.action.get('views'):
40+ self.action_view_ids = map(lambda y:y[0], filter(lambda x:x[1] == 'tree',self.action['views']))
41 if self.action['view_type']=='form':
42 mode = (self.action['view_mode'] or 'form,tree').split(',')
43 self.screen = Screen(self.action['res_model'], view_type=mode, context=self.context, view_ids = view_id, domain=self.domain)
44@@ -81,7 +83,7 @@
45 self.screen.switch_view()
46
47 def _sig_search(self, *args):
48- win = win_search(self.action['res_model'], domain=self.domain, context=self.context)
49+ win = win_search(self.action['res_model'], view_ids = self.action_view_ids, domain=self.domain, context=self.context)
50 res = win.go()
51 if res:
52 self.screen.clear()
53@@ -96,7 +98,7 @@
54 return True
55
56 def display(self, model, model_field):
57- limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100) or False
58+ limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100) or False
59 res_id = rpc.session.rpc_exec_auth('/object', 'execute',
60 self.action['res_model'], 'search', self.domain, 0,
61 limit, False, self.context)