[REF] !python block test should not impose 'self': just use 'model' to reference model.

bzr revid: jth@openerp.com-20100408201854-curxhua4ms2bgmfv
This commit is contained in:
Julien Thewys 2010-04-08 22:18:54 +02:00
parent fc9bf8716a
commit f6c1339c77
1 changed files with 2 additions and 1 deletions

View File

@ -348,7 +348,8 @@ class YamlInterpreter(object):
python, statements = node.items()[0]
model = self.get_model(python.model)
statements = statements.replace("\r\n", "\n")
code_context = {'self': model, 'cr': self.cr, 'uid': self.uid, 'log': log, 'context': self.context}
code_context = {'model': model, 'cr': self.cr, 'uid': self.uid, 'log': log, 'context': self.context}
code_context.update({'self': model}) # remove me when no !python block test uses 'self' anymore
try:
code = compile(statements, self.filename, 'exec')
eval(code, {'ref': self.get_id}, code_context)