openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #07301
[Merge] lp:~openerp-dev/openobject-client/trunk-bug-776961-nch into lp:openobject-client
Naresh(OpenERP) has proposed merging lp:~openerp-dev/openobject-client/trunk-bug-776961-nch into lp:openobject-client.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
Related bugs:
Bug #776961 in OpenERP GTK Client: "dashboard:view_id provided in ir.actions.act_window.view is not taken into consideration."
https://bugs.launchpad.net/openobject-client/+bug/776961
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-776961-nch/+merge/62107
--
https://code.launchpad.net/~openerp-dev/openobject-client/trunk-bug-776961-nch/+merge/62107
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client/trunk-bug-776961-nch.
=== modified file 'bin/modules/gui/window/win_search.py'
--- bin/modules/gui/window/win_search.py 2011-02-14 12:04:15 +0000
+++ bin/modules/gui/window/win_search.py 2011-05-24 11:27:29 +0000
@@ -107,7 +107,7 @@
class win_search(object):
- def __init__(self, model, sel_multi=True, ids=[], context={}, domain = [], parent=None):
+ def __init__(self, model, sel_multi=True, ids=[], view_ids=False, context={}, domain = [], parent=None):
self.model = model
self.sel_multi = sel_multi
self.ids = ids
@@ -118,7 +118,7 @@
parent = service.LocalService('gui.main').window
self.parent = parent
self.win.set_transient_for(parent)
- self.screen = Screen(model, view_type=['tree'], show_search=True, domain=domain,
+ self.screen = Screen(model, view_type=['tree'], view_ids=view_ids, show_search=True, domain=domain,
context=context, parent=self.win, win_search=True)
self.view = self.screen.current_view
if self.screen.filter_widget.focusable:
=== modified file 'bin/widget/view/form_gtk/action.py'
--- bin/widget/view/form_gtk/action.py 2011-05-06 10:52:28 +0000
+++ bin/widget/view/form_gtk/action.py 2011-05-24 11:27:29 +0000
@@ -48,7 +48,7 @@
self.action = rpc.session.rpc_exec_auth('/object', 'execute', type, 'read', [self.act_id], False, rpc.session.context)[0]
if 'view_mode' in attrs:
self.action['view_mode'] = attrs['view_mode']
-
+ self.action_view_ids = False
if self.action['type'] == 'ir.actions.act_window':
if not self.action.get('domain', False):
self.action['domain'] = '[]'
@@ -60,6 +60,8 @@
view_id = []
if self.action['view_id']:
view_id = [self.action['view_id'][0]]
+ if self.action.get('views'):
+ self.action_view_ids = map(lambda y:y[0], filter(lambda x:x[1] == 'tree',self.action['views']))
if self.action['view_type']=='form':
mode = (self.action['view_mode'] or 'form,tree').split(',')
self.screen = Screen(self.action['res_model'], view_type=mode, context=self.context, view_ids = view_id, domain=self.domain)
@@ -81,7 +83,7 @@
self.screen.switch_view()
def _sig_search(self, *args):
- win = win_search(self.action['res_model'], domain=self.domain, context=self.context)
+ win = win_search(self.action['res_model'], view_ids = self.action_view_ids, domain=self.domain, context=self.context)
res = win.go()
if res:
self.screen.clear()
@@ -96,7 +98,7 @@
return True
def display(self, model, model_field):
- limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100) or False
+ limit = self.screen.current_view.view_type != 'graph' and self.action.get('limit', 100) or False
res_id = rpc.session.rpc_exec_auth('/object', 'execute',
self.action['res_model'], 'search', self.domain, 0,
limit, False, self.context)
Follow ups