From d24ff706a9194fe33c9f98aca0c0424486b661cf Mon Sep 17 00:00:00 2001 From: Denis Ledoux Date: Thu, 24 Sep 2015 17:23:16 +0200 Subject: [PATCH] [FIX] account_followup: check_description constraint must take into account the translation When adding a `%` in the followup letter content, the constraint checking there is no syntax error is supposed to raise a warning, telling '%' must be set as `%%` when you want to display this percentage char. This constraint did not take into account the translation, so when being in another language (e.g. French), and adding a `%`, the warning was not raised, while it should have been. Closes #8680 --- addons/account_followup/account_followup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 27caab704e2..b6b1647cfa9 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -82,7 +82,8 @@ Best Regards, def _check_description(self, cr, uid, ids, context=None): - for line in self.browse(cr, uid, ids, context=context): + lang = self.pool['res.users'].browse(cr, uid, uid, context=context).lang + for line in self.browse(cr, uid, ids, context=dict(context or {}, lang=lang)): if line.description: try: line.description % {'partner_name': '', 'date':'', 'user_signature': '', 'company_name': ''}