[fix] check followup message

lp bug: https://launchpad.net/bugs/768241 fixed

bzr revid: fp@tinyerp.com-20110924104225-0mvbgeofjm2tnj81
This commit is contained in:
Fabien Pinckaers 2011-09-24 12:42:25 +02:00
parent 735276e89e
commit d9318e92e6
1 changed files with 14 additions and 1 deletions

View File

@ -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:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: