From: Bhavik Bagdiya Date: Wed, 10 Sep 2014 12:52:04 +0000 (+0530) Subject: [IMP] share: better way to restrict the feature to the technical group. X-Git-Url: http://git.inspyration.org/?a=commitdiff_plain;h=e924aec93c2585f7bbf5f32c941f78a9d51e0e54;p=odoo%2Fodoo.git [IMP] share: better way to restrict the feature to the technical group. Reverted commit 57a12121057df9fee039a54f5b947c0e8a917fe9 that introduced an unnecessary call to has_group, as it could be done un share_wizard.py once for the session. Removed the group_share_user, not necessary anymore. --- diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py index 49879d4..f413a12 100644 --- a/addons/share/__openerp__.py +++ b/addons/share/__openerp__.py @@ -42,12 +42,10 @@ This is extremely useful for collaborative work, knowledge sharing, synchronization with other companies. """, 'website': 'https://www.odoo.com', - 'demo': ['share_demo.xml'], 'data': [ 'security/share_security.xml', 'res_users_view.xml', 'wizard/share_wizard_view.xml', - 'share_data.xml', 'views/share.xml', ], 'installable': True, diff --git a/addons/share/security/share_security.xml b/addons/share/security/share_security.xml index 2c68cc6..9d21f62 100644 --- a/addons/share/security/share_security.xml +++ b/addons/share/security/share_security.xml @@ -6,13 +6,5 @@ 26 - - - User - -Members of this groups have access to the sharing wizard, which allows them to invite external users to view or edit some of their documents. - - - diff --git a/addons/share/share_data.xml b/addons/share/share_data.xml deleted file mode 100644 index c64a909..0000000 --- a/addons/share/share_data.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/addons/share/share_demo.xml b/addons/share/share_demo.xml deleted file mode 100644 index 139c81d..0000000 --- a/addons/share/share_demo.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - diff --git a/addons/share/static/src/js/share.js b/addons/share/static/src/js/share.js index ed9366f..2211295 100644 --- a/addons/share/static/src/js/share.js +++ b/addons/share/static/src/js/share.js @@ -56,18 +56,14 @@ openerp.share = function(session) { var self = this; this._super(this); has_share(function() { - new session.web.Model('res.users').call('has_group', ['base.group_no_one']).done(function(group_status) { - if (group_status == true) { - self.add_items('other', [ - { label: _t('Share'), - callback: self.on_click_share, - classname: 'oe_share' }, - { label: _t('Embed'), - callback: self.on_click_share_link, - classname: 'oe_share' }, - ]); - } - }); + self.add_items('other', [ + { label: _t('Share'), + callback: self.on_click_share, + classname: 'oe_share' }, + { label: _t('Embed'), + callback: self.on_click_share_link, + classname: 'oe_share' }, + ]); }); }, diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 4ce33e2..ac8874f 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -70,7 +70,7 @@ class share_wizard(osv.TransientModel): return group_id in self.pool.get('res.users').read(cr, uid, [uid], ['groups_id'], context=context)[0]['groups_id'] def has_share(self, cr, uid, unused_param, context=None): - return self.has_group(cr, uid, module='share', group_xml_id='group_share_user', context=context) + return self.has_group(cr, uid, module='base', group_xml_id='group_no_one', context=context) def _user_type_selection(self, cr, uid, context=None): """Selection values may be easily overridden/extended via inheritance""" @@ -641,7 +641,7 @@ class share_wizard(osv.TransientModel): _('Action and Access Mode are required to create a shared access.'), context=context) self._assert(self.has_share(cr, uid, wizard_data, context=context), - _('You must be a member of the Share/User group to use the share wizard.'), + _('You must be a member of the Technical group to use the share wizard.'), context=context) if wizard_data.user_type == 'emails': self._assert((wizard_data.new_users or wizard_data.email_1 or wizard_data.email_2 or wizard_data.email_3),