From 52d2b7fbcf7d1d9091281ab8f63bde6f842f6da4 Mon Sep 17 00:00:00 2001 From: Invitu Date: Wed, 21 Oct 2015 20:21:55 -1000 Subject: [PATCH] [FIX] auth_signup: translate password reset email The password reset email is in the language of the user clicking on the button, not in the one of the targeted user. Fixes #9194 Closes ##9195 --- addons/auth_signup/res_users.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index f9e5fe9062f..39ef46f1b78 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -274,8 +274,7 @@ class res_users(osv.Model): partner_ids = [user.partner_id.id for user in self.browse(cr, uid, ids, context)] res_partner.signup_prepare(cr, uid, partner_ids, signup_type="reset", expiration=now(days=+1), context=context) - if not context: - context = {} + context = dict(context or {}) # send email to users with their signup url template = False @@ -292,6 +291,7 @@ class res_users(osv.Model): for user in self.browse(cr, uid, ids, context): if not user.email: raise osv.except_osv(_("Cannot send email: user has no email address."), user.name) + context['lang'] = user.lang # translate in targeted user language self.pool.get('email.template').send_mail(cr, uid, template.id, user.id, force_send=True, raise_exception=True, context=context) def create(self, cr, uid, values, context=None):