diff options
| author | Fabien Pinckaers <fp@tinyerp.com> | 2011-09-24 12:42:25 +0200 |
|---|---|---|
| committer | Fabien Pinckaers <fp@tinyerp.com> | 2011-09-24 12:42:25 +0200 |
| commit | d9318e92e6a2b181f99889a98e1eefdc6d2db2bb (patch) | |
| tree | 28df49ab5b7ab96fada031efdf93c38b7ff82b9e | |
| parent | 735276e89e380abb93ac27d668db1bcf364ba929 (diff) | |
[fix] check followup message
lp bug: https://launchpad.net/bugs/768241 fixed
bzr revid: fp@tinyerp.com-20110924104225-0mvbgeofjm2tnj81
| -rw-r--r-- | addons/account_followup/account_followup.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/addons/account_followup/account_followup.py b/addons/account_followup/account_followup.py index 06a53bb9548..fd8b7026d74 100644 --- a/addons/account_followup/account_followup.py +++ b/addons/account_followup/account_followup.py @@ -63,7 +63,20 @@ class followup_line(osv.osv): } _defaults = { 'start': 'days', + } + def _check_description(self, cr, uid, ids, context=None): + for line in self.browse(cr, uid, ids, context=context): + if line.description: + try: + line.description % {'partner_name': '', 'date':'', 'user_signature': '', 'company_name': ''} + except: + return False + return True + + _constraints = [ + (_check_description, 'Your description is invalid, use the right legend or %% if you want to use the percent character.', ['description']), + ] followup_line() @@ -101,4 +114,4 @@ Thanks, res_company() -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
