From d9318e92e6a2b181f99889a98e1eefdc6d2db2bb Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sat, 24 Sep 2011 12:42:25 +0200 Subject: [PATCH] [fix] check followup message lp bug: https://launchpad.net/bugs/768241 fixed bzr revid: fp@tinyerp.com-20110924104225-0mvbgeofjm2tnj81 --- addons/account_followup/account_followup.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) 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: