From 086dbfa5cff8f0bd288d478f8b523783e15e56df Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Tue, 8 Oct 2013 15:08:30 +0530 Subject: [PATCH] [REM]: unwanted argument from url and allow to add default state when new attendee is created bzr revid: aja@tinyerp.com-20131008093830-b5wz38dlcll2ewuj --- addons/base_calendar/base_calendar.py | 5 +---- addons/base_calendar/controllers/main.py | 8 ++++---- addons/base_calendar/crm_meeting_data.xml | 2 +- addons/base_calendar/static/src/js/base_calendar.js | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 74351f87940..20acbcc5d5b 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -235,7 +235,6 @@ class calendar_attendee(osv.osv): ('declined', 'Declined'), ('accepted', 'Accepted'), ('delegated', 'Delegated')], 'Status', readonly=True, \ - write= ['portal.group_anonymous'] , help="Status of the attendee's participation"), 'rsvp': fields.boolean('Required Reply?', help="Indicats whether the favor of a reply is requested"), @@ -1008,8 +1007,6 @@ rule or repeating pattern of time to exclude from the recurring rule."), for partner in event.partner_ids: if partner.id in attendees: continue - local_context = context.copy() - local_context.pop('default_state', None) access_token = self.new_invitation_token(cr, uid, event, partner.id) att_id = self.pool.get('calendar.attendee').create(cr, uid, { 'partner_id': partner.id, @@ -1017,7 +1014,7 @@ rule or repeating pattern of time to exclude from the recurring rule."), 'ref': self._name+','+str(event.id), 'access_token': access_token, 'email': partner.email, - }, context=local_context) + }, context=context) if partner.email: mail_to = mail_to + " " + partner.email self.write(cr, uid, [event.id], { diff --git a/addons/base_calendar/controllers/main.py b/addons/base_calendar/controllers/main.py index 3ee025be849..846d004c8c5 100644 --- a/addons/base_calendar/controllers/main.py +++ b/addons/base_calendar/controllers/main.py @@ -16,21 +16,21 @@ class meetting_invitation(http.Controller): with registry.cursor() as cr: attendee_ids = attendee_pool.search(cr, SUPERUSER_ID, [('access_token','=',token)]) attendee_pool.do_accept(cr, SUPERUSER_ID, attendee_ids) - return self.view(db, token, action, id, view='form') + return self.view(db, action, id, view='form') @http.route('/meeting_invitation/decline', type='http', auth="none") - def declined(self, db, token, id): + def declined(self, db, token, action, id): # http://hostname:8069/meeting_invitation/accept/id=1&token=&db= registry = openerp.modules.registry.RegistryManager.get(db) attendee_pool = registry.get('calendar.attendee') with registry.cursor() as cr: attendee_ids = attendee_pool.search(cr, SUPERUSER_ID, [('access_token','=',token)]) attendee_pool.do_decline(cr, SUPERUSER_ID, attendee_ids) - return self.view(db, token, action, id, view='form') + return self.view(db, action, id, view='form') @http.route('/meeting_invitation/view', type='http', auth="none") - def view(self, db, token, action, id, view='calendar'): + def view(self, db, action, id, view='calendar'): # http://hostname:8069/meeting_invitation/view/id=1&token=&db=&view= js = "\n ".join('' % i for i in webmain.manifest_list('js', db=db)) css = "\n ".join('' % i for i in webmain.manifest_list('css',db=db)) diff --git a/addons/base_calendar/crm_meeting_data.xml b/addons/base_calendar/crm_meeting_data.xml index 3e0c79ca701..725dc08d934 100644 --- a/addons/base_calendar/crm_meeting_data.xml +++ b/addons/base_calendar/crm_meeting_data.xml @@ -119,7 +119,7 @@ Decline
- --
Sent by ${object.user_id.name} from ${object.user_id.company_id.name}. View this meeting detail directly in OpenERP. + --
Sent by ${object.user_id.name} from ${object.user_id.company_id.name}. View this meeting detail directly in OpenERP.
diff --git a/addons/base_calendar/static/src/js/base_calendar.js b/addons/base_calendar/static/src/js/base_calendar.js index 4f499da08fd..6527bbd7dc7 100644 --- a/addons/base_calendar/static/src/js/base_calendar.js +++ b/addons/base_calendar/static/src/js/base_calendar.js @@ -14,7 +14,7 @@ instance.base_calendar = {} }, start: function() { var self = this; - if(!instance.session.session_is_valid(self.db)) { + if(instance.session.session_is_valid(self.db)) { self.redirect_meeting_view(self.db,self.action,self.id,self.view); } else { new instance.web.Model("crm.meeting").call('get_attendee',[self.id]).then(function(res){