From f6c1339c773e6614b1763ace9b05657b8e22bca1 Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Thu, 8 Apr 2010 22:18:54 +0200 Subject: [PATCH] [REF] !python block test should not impose 'self': just use 'model' to reference model. bzr revid: jth@openerp.com-20100408201854-curxhua4ms2bgmfv --- bin/tools/yaml_import.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/tools/yaml_import.py b/bin/tools/yaml_import.py index 67cc58b67c1..76fc2e442ca 100644 --- a/bin/tools/yaml_import.py +++ b/bin/tools/yaml_import.py @@ -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)