[REM]: unwanted argument from url and allow to add default state when new attendee is created
bzr revid: aja@tinyerp.com-20131008093830-b5wz38dlcll2ewuj
This commit is contained in:
parent
c30200fc9b
commit
086dbfa5cf
|
@ -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], {
|
||||
|
|
|
@ -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('<script type="text/javascript" src="%s"></script>' % i for i in webmain.manifest_list('js', db=db))
|
||||
css = "\n ".join('<link rel="stylesheet" href="%s">' % i for i in webmain.manifest_list('css',db=db))
|
||||
|
|
|
@ -119,7 +119,7 @@
|
|||
<a style="padding: 8px 30px 8px 30px;border-radius: 6px;border: 1px solid #CCCCCC;background:#808080;text-decoration: none;color:#FFFFFF;" href="${ctx['base_url']}/meeting_invitation/decline?db=${ctx['dbname']}&token=${ctx['att_obj'].access_token}&action=${ctx['action_id']}&id=${object.id}">Decline</a>
|
||||
</div>
|
||||
<div>
|
||||
-- </br> Sent by ${object.user_id.name} from ${object.user_id.company_id.name}. View this meeting detail <a href="${ctx['base_url']}/meeting_invitation/view?db=${ctx['dbname']}&token=${ctx['att_obj'].access_token}&id=${object.id}">directly in OpenERP.</a>
|
||||
-- </br> Sent by ${object.user_id.name} from ${object.user_id.company_id.name}. View this meeting detail <a href="${ctx['base_url']}/meeting_invitation/view?db=${ctx['dbname']}&action=${ctx['action_id']}&id=${object.id}">directly in OpenERP.</a>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -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){
|
||||
|
|
Loading…
Reference in New Issue