diff --git a/product/ERP5Type/Accessor/Base.py b/product/ERP5Type/Accessor/Base.py index 35252dc195a4ba9d09a7856d3c649a33a4c336d9..d02de58d615c3b09d31ad3a65e8aa238bb82e05d 100644 --- a/product/ERP5Type/Accessor/Base.py +++ b/product/ERP5Type/Accessor/Base.py @@ -132,19 +132,26 @@ class Getter(Method): self._storage_id = storage_id self._is_tales_type = (property_type == 'tales') - def __call__(self, instance, *args, **kw): + def __call__(self, instance, object=None, *args, **kw): if len(args) > 0: default = args[0] else: default = self._default - value = getattr(aq_base(instance), self._storage_id, None) # No acquisition on properties + # No acquisition on properties + value = getattr(aq_base(instance), self._storage_id, None) if value is not None: if self._is_tales_type and kw.get('evaluate', 1): - return evaluateTales(instance, value) + if object is not None: + return evaluateTales(object, value) + else: + return evaluateTales(instance, value) else: return value if default is not None and self._is_tales_type and kw.get('evaluate', 1): - return evaluateTales(instance, default) + if object is not None: + return evaluateTales(object, default) + else: + return evaluateTales(instance, default) return default psyco.bind(__call__)