diff options
| author | Denis Ledoux <dle@odoo.com> | 2015-09-24 17:23:16 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@odoo.com> | 2015-09-24 17:28:00 +0200 |
| commit | d24ff706a9194fe33c9f98aca0c0424486b661cf (patch) | |
| tree | e282a8ebb3e8edb3b3f8c246cc972dc72b6bfb5e | |
| parent | f0b8e523209d1e1a5186a97fc659f07b77ed630a (diff) | |
[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
| -rw-r--r-- | addons/account_followup/account_followup.py | 3 |
1 files changed, 2 insertions, 1 deletions
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': ''} |
