[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
This commit is contained in:
Denis Ledoux 2015-09-24 17:23:16 +02:00
parent f0b8e52320
commit d24ff706a9
1 changed files with 2 additions and 1 deletions

View File

@ -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': ''}