changeset 3d64ff95a6b9 in proteus:5.0
details: https://hg.tryton.org/proteus?cmd=changeset;node=3d64ff95a6b9
description:
Ensure id is always available in EvalEnvironment
issue8722
review286051002
(grafted from b2859b99d2c49b0cb5427196f235c051aba62cd9)
diffstat:
proteus/__init__.py | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diffs (21 lines):
diff -r 514776dfcf40 -r 3d64ff95a6b9 proteus/__init__.py
--- a/proteus/__init__.py Thu Oct 24 00:22:06 2019 +0200
+++ b/proteus/__init__.py Thu Oct 24 19:00:37 2019 +0200
@@ -25,6 +25,8 @@
self.eval_type = eval_type
def __getitem__(self, item):
+ if item == 'id':
+ return self.parent.id
if item == '_parent_' + self.parent._parent_name \
and self.parent._parent:
return _EvalEnvironment(self.parent._parent,
@@ -56,6 +58,8 @@
__repr__ = __str__
def __contains__(self, item):
+ if item == 'id':
+ return True
if item == '_parent_' + self.parent._parent_name \
and self.parent._parent:
return True