[FIX] event: translate templates into user language
authorMartin Trigaux <mat@openerp.com>
Fri, 19 Sep 2014 09:06:17 +0000 (11:06 +0200)
committerMartin Trigaux <mat@openerp.com>
Fri, 19 Sep 2014 09:07:04 +0000 (11:07 +0200)
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.

addons/event/event.py

index 2b2f937..937884f 100644 (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):