From ef4c13fad553cbdae08cc82a8f07991f4539f1b6 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 5 May 2011 18:14:26 +0200 Subject: [PATCH] [FIX] share: hide Share button when user does not belong to Sharing group bzr revid: odo@openerp.com-20110505161426-c4ocuy98mgbceq5w --- addons/share/web/editors.py | 14 ++++++++++---- addons/share/wizard/share_wizard.py | 12 ++++++++++++ 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/addons/share/web/editors.py b/addons/share/web/editors.py index fd6199a4fd6..1928b644073 100644 --- a/addons/share/web/editors.py +++ b/addons/share/web/editors.py @@ -11,8 +11,13 @@ class ShareActionEditor(openobject.templating.TemplateEditor): share_opener_insertion = output.index( '\n', output.index(self.ADD_SHARE_SECTION)) + 1 - return output[:share_opener_insertion] + \ - '''

${_("Sharing")}

+ return output[:share_opener_insertion] + ''' + <% + if 'has_share' not in cp.session: + cp.session['has_share'] = rpc.RPCProxy('share.wizard').has_share() + %> + % if cp.session['has_share']: +

${_("Sharing")}