[FIX] event: translate templates into user language

When sending an email of the registration/confirmation, the context was lost and the tempate sticked in en_US.
With the patch, the template will use the current user's language.
This commit is contained in:
Martin Trigaux
2014-09-19 11:07:04 +02:00
parent a218a9ed3f
commit bcc08ee422
+2 -2
View File
@@ -370,7 +370,7 @@ class event_registration(osv.osv):
else:
template_id = registration.event_id.email_registration_id.id
if template_id:
mail_message = self.pool.get('email.template').send_mail(cr,uid,template_id,registration.id)
self.pool.get('email.template').send_mail(cr,uid,template_id,registration.id, context=context)
return True
def mail_user_confirm(self, cr, uid, ids, context=None):
@@ -380,7 +380,7 @@ class event_registration(osv.osv):
for registration in self.browse(cr, uid, ids, context=context):
template_id = registration.event_id.email_confirmation_id.id
if template_id:
mail_message = self.pool.get('email.template').send_mail(cr,uid,template_id,registration.id)
self.pool.get('email.template').send_mail(cr,uid,template_id,registration.id, context=context)
return True
def onchange_contact_id(self, cr, uid, ids, contact, partner, context=None):