From 22b1bb8abb0cb7148d0cbeadea1fe0aba2e11f97 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Thu, 29 Sep 2011 15:07:01 +0200 Subject: [PATCH] [FIX] do not remove 'multi=True' actions in fields_view_get for tree view fields_view_get removed multi=True actions from the result of ir_values.get_actions('client_action_multi', ...), so that multi actions would not be displayed in the form view's sidebar in the GTK client. The web client has a sidebar in both cases, the GTK client just ignores 'toolbar' key if not in tree view, so don't remove 'multi' actions in tree view toolbar, to avoid having to perform one more RPC call (explicit ir_values.get) in web client. lp bug: https://launchpad.net/bugs/856378 fixed bzr revid: xmo@openerp.com-20110929130701-65ubx1o0swk889nl --- openerp/osv/orm.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/openerp/osv/orm.py b/openerp/osv/orm.py index 5a18b893910..7e3ffa7fcb0 100644 --- a/openerp/osv/orm.py +++ b/openerp/osv/orm.py @@ -2069,8 +2069,9 @@ class BaseModel(object): context) resprint = map(clean, resprint) resaction = map(clean, resaction) - resaction = filter(lambda x: not x.get('multi', False), resaction) - resprint = filter(lambda x: not x.get('multi', False), resprint) + if view_type != 'tree': + resaction = filter(lambda x: not x.get('multi'), resaction) + resprint = filter(lambda x: not x.get('multi'), resprint) resrelate = map(lambda x: x[2], resrelate) for x in resprint + resaction + resrelate: