From 7c026132ff581f183b855fe80e4b11ea5ba6a5ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 10 Apr 2013 14:51:17 +0200 Subject: [REF] event: visibility moved from portal_event to event. Customized rules, removed now unnecessary files. bzr revid: tde@openerp.com-20130410125117-m9ir36qhkp9fqax1 --- addons/event/event.py | 10 ++++++++++ addons/event/event_view.xml | 1 + addons/event/security/event_security.xml | 32 +++++++++++++++++++++----------- 3 files changed, 32 insertions(+), 11 deletions(-) (limited to 'addons/event') diff --git a/addons/event/event.py b/addons/event/event.py index 9e50128c592..cdaf333f749 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -173,6 +173,13 @@ class event_event(osv.osv): continue return res + def _get_visibility_selection(self, cr, uid, context=None): + """ Overriden in project_issue to offer more options """ + return [('public', 'All Users'), + ('employees', 'Employees Only')] + # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field + _visibility_selection = lambda self, *args, **kwargs: self._get_visibility_selection(*args, **kwargs) + _columns = { 'name': fields.char('Name', size=64, required=True, translate=True, readonly=False, states={'done': [('readonly', True)]}), 'user_id': fields.many2one('res.users', 'Responsible User', readonly=False, states={'done': [('readonly', True)]}), @@ -210,11 +217,14 @@ class event_event(osv.osv): 'note': fields.text('Description', readonly=False, states={'done': [('readonly', True)]}), 'company_id': fields.many2one('res.company', 'Company', required=False, change_default=True, readonly=False, states={'done': [('readonly', True)]}), 'is_subscribed' : fields.function(_subscribe_fnc, type="boolean", string='Subscribed'), + 'visibility': fields.selection(_visibility_selection, 'Privacy / Visibility', + select=True, required=True), } _defaults = { 'state': 'draft', 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'event.event', context=c), 'user_id': lambda obj, cr, uid, context: uid, + 'visibility': 'employees', } def subscribe_to_event(self, cr, uid, ids, context=None): diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index 8efae21f676..c061c842232 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -76,6 +76,7 @@
diff --git a/addons/event/security/event_security.xml b/addons/event/security/event_security.xml index 83039ca4686..90a232731a7 100644 --- a/addons/event/security/event_security.xml +++ b/addons/event/security/event_security.xml @@ -25,25 +25,35 @@ - - Event multi-company + + Event: multi-company - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + ['|', + ('company_id', '=', False), + ('company_id', 'child_of', [user.company_id.id]), + ] + - - - Event Registration multi-company + + Event/Registration: multi-company - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + ['|', + ('company_id', '=', False), + ('company_id', 'child_of', [user.company_id.id]), + ] + - - - Report Event Registration multi-company + + Event/Report Registration: multi-company - ['|',('company_id','=',False),('company_id','child_of',[user.company_id.id])] + ['|', + ('company_id', '=', False), + ('company_id', 'child_of', [user.company_id.id]), + ] + -- cgit v1.2.3 From 9cc33004f60a37604d5d3c7476776c4f95ad2867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Fri, 12 Apr 2013 14:51:46 +0200 Subject: [CLEAN] event: light cleaning. bzr revid: tde@openerp.com-20130412125146-ec2moex2e802skrz --- addons/event/event.py | 1 - 1 file changed, 1 deletion(-) (limited to 'addons/event') diff --git a/addons/event/event.py b/addons/event/event.py index cdaf333f749..96bd32e0619 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -174,7 +174,6 @@ class event_event(osv.osv): return res def _get_visibility_selection(self, cr, uid, context=None): - """ Overriden in project_issue to offer more options """ return [('public', 'All Users'), ('employees', 'Employees Only')] # Lambda indirection method to avoid passing a copy of the overridable method when declaring the field -- cgit v1.2.3