From 8fd72aff40eb757013eaee6a0c182c9e1acee7c5 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 5 May 2011 18:12:21 +0200 Subject: [PATCH 1/8] [FIX] share: avoid crash in web addon with empty share filter bzr revid: odo@openerp.com-20110505161221-d4k3y8v81qz2wbrp --- addons/share/web/controllers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/share/web/controllers.py b/addons/share/web/controllers.py index aa689019259..1b57d960e99 100644 --- a/addons/share/web/controllers.py +++ b/addons/share/web/controllers.py @@ -13,7 +13,7 @@ class ShareWizardController(openerp.controllers.SecuredController): _cp_path = "/share" @expose() - def index(self, domain, search_domain, context, view_id, action_id=None): + def index(self, domain, context, view_id, search_domain='[]', action_id=None): context = ast.literal_eval(context) if not action_id: From ef4c13fad553cbdae08cc82a8f07991f4539f1b6 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 5 May 2011 18:14:26 +0200 Subject: [PATCH 2/8] [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")}