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: