diff --git a/addons/event/event.py b/addons/event/event.py index bd16194bcef..ce72dadb2cc 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -216,15 +216,16 @@ class event_event(osv.osv): user_pool = self.pool.get('res.users') user = user_pool.browse(cr, uid, uid, context=context) curr_reg_ids = register_pool.search(cr, uid, [('user_id', '=', user.id), ('event_id', '=' , ids[0])]) + #the subscription is done with UID = 1 because in case we share the kanban view, we want anyone to be able to subscribe if not curr_reg_ids: - curr_reg_ids = [register_pool.create(cr, uid, {'event_id': ids[0] ,'email': user.user_email, - 'name':user.name, 'user_id': user.id,})] - return register_pool.confirm_registration(cr, uid, curr_reg_ids, context=context) + curr_reg_ids = [register_pool.create(cr, 1, {'event_id': ids[0] ,'email': user.user_email, 'name':user.name, 'user_id': user.id,})] + return register_pool.confirm_registration(cr, 1, curr_reg_ids, context=context) - def unsubscribe_to_event(self,cr,uid,ids,context=None): + def unsubscribe_to_event(self, cr, uid, ids, context=None): register_pool = self.pool.get('event.registration') - curr_reg_ids = register_pool.search(cr, uid, [('user_id', '=', uid), ('event_id', '=', ids[0])]) - return register_pool.button_reg_cancel(cr, uid, curr_reg_ids, context=context) + #the unsubscription is done with UID = 1 because in case we share the kanban view, we want anyone to be able to unsubscribe + curr_reg_ids = register_pool.search(cr, 1, [('user_id', '=', uid), ('event_id', '=', ids[0])]) + return register_pool.button_reg_cancel(cr, 1, curr_reg_ids, context=context) def _check_closing_date(self, cr, uid, ids, context=None): for event in self.browse(cr, uid, ids, context=context): diff --git a/addons/event_share/__init__.py b/addons/event_share/__init__.py deleted file mode 100644 index 8dbeda71145..00000000000 --- a/addons/event_share/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import wizard -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/event_share/__openerp__.py b/addons/event_share/__openerp__.py deleted file mode 100644 index f6ad583364a..00000000000 --- a/addons/event_share/__openerp__.py +++ /dev/null @@ -1,35 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - - -{ - 'name': 'Events Share', - 'version': '0.1', - 'category': 'Tools', - 'complexity': "easy", - 'description': """ """, - 'author': 'OpenERP SA', - 'depends': ['event','share'], - 'installable': True, - #'application': True, - 'auto_install': False, -} -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/event_share/wizard/__init__.py b/addons/event_share/wizard/__init__.py deleted file mode 100644 index d62c6170854..00000000000 --- a/addons/event_share/wizard/__init__.py +++ /dev/null @@ -1,24 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -import wizard_share -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - diff --git a/addons/event_share/wizard/wizard_share.py b/addons/event_share/wizard/wizard_share.py deleted file mode 100644 index 5ed940ff05d..00000000000 --- a/addons/event_share/wizard/wizard_share.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2011 OpenERP S.A (). -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from osv import osv, fields -from tools.translate import _ - -UID_ROOT = 1 -EVENT_ACCESS = ('perm_read', 'perm_write', 'perm_create') - -class share_wizard_event(osv.osv_memory): - """Inherited share wizard to automatically create appropriate - menus in the selected portal upon sharing with a portal group.""" - _inherit = "share.wizard" - - def _add_access_rights_for_share_group(self, cr, uid, group_id, mode, fields_relations, context=None): - """Adds access rights to group_id on object models referenced in ``fields_relations``, - intersecting with access rights of current user to avoid granting too much rights - """ - res = super(share_wizard_event, self)._add_access_rights_for_share_group(cr, uid, group_id, mode, fields_relations, context=context) - access_model = self.pool.get('ir.model.access') - - access_ids = access_model.search(cr,uid,[('group_id','=',group_id)],context = context) - for record in access_model.browse(cr,uid,access_ids,context = context): - if record.model_id.model == 'event.registration': - access_model.write(cr, uid, record.id, {'perm_read': True, 'perm_write': True,'perm_create':True}) - -share_wizard_event() - - -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file