[FIX] strip server action code before passing it to eval

Python 2.7's compile handles trailing whitespaces correctly, Python
2.6 does not and blows up.

bzr revid: xmo@openerp.com-20130304164423-83vm9teu7b3c52y3
This commit is contained in:
Xavier Morel 2013-03-04 17:44:23 +01:00
parent b921444d6f
commit 018416630d
1 changed files with 1 additions and 1 deletions

View File

@ -608,7 +608,7 @@ class actions_server(osv.osv):
.read(cr, uid, action.action_id.id, context=context)
if action.state=='code':
eval(action.code, cxt, mode="exec", nocopy=True) # nocopy allows to return 'action'
eval(action.code.strip(), cxt, mode="exec", nocopy=True) # nocopy allows to return 'action'
if 'action' in cxt:
return cxt['action']