diff --git a/addons/share/__openerp__.py b/addons/share/__openerp__.py index d65a790eaf8..45a2a225925 100644 --- a/addons/share/__openerp__.py +++ b/addons/share/__openerp__.py @@ -44,6 +44,7 @@ synchronization with other companies. 'website': 'https://www.odoo.com', 'demo': ['share_demo.xml'], 'data': [ + 'security/ir.model.access.csv', 'security/share_security.xml', 'res_users_view.xml', 'wizard/share_wizard_view.xml', diff --git a/addons/share/security/ir.model.access.csv b/addons/share/security/ir.model.access.csv new file mode 100644 index 00000000000..526ccde38c8 --- /dev/null +++ b/addons/share/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +"access_ir_ui_menu_group_shared","ir_ui_menu group_shared","base.model_ir_ui_menu",group_shared,1,0,0,0 diff --git a/addons/share/security/share_security.xml b/addons/share/security/share_security.xml index 2c68cc69937..b65875608b7 100644 --- a/addons/share/security/share_security.xml +++ b/addons/share/security/share_security.xml @@ -14,5 +14,13 @@ Members of this groups have access to the sharing wizard, which allows them to i + + + Shared Group + +This group is a template group for shared users, giving basic access needs, the menus for instance. + + 1 + diff --git a/addons/share/views/share.xml b/addons/share/views/share.xml index aa507eed3e2..0495c39e252 100644 --- a/addons/share/views/share.xml +++ b/addons/share/views/share.xml @@ -9,5 +9,13 @@ + diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index b0ff0cfca00..6fa2a43e365 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -212,8 +212,15 @@ class share_wizard(osv.TransientModel): def _create_share_group(self, cr, uid, wizard_data, context=None): group_obj = self.pool.get('res.groups') share_group_name = '%s: %s (%d-%s)' %('Shared', wizard_data.name, uid, time.time()) + values = {'name': share_group_name, 'share': True} + try: + implied_group_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'share', 'group_shared')[1] + except ValueError: + implied_group_id = None + if implied_group_id: + values['implied_ids'] = [(4, implied_group_id)] # create share group without putting admin in it - return group_obj.create(cr, UID_ROOT, {'name': share_group_name, 'share': True}, {'noadmin': True}) + return group_obj.create(cr, UID_ROOT, values, {'noadmin': True}) def _create_new_share_users(self, cr, uid, wizard_data, group_id, context=None): """Create one new res.users record for each email address provided in