From 797974301b0271e6dd260ab973ece02b788ddfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com> Date: Tue, 14 Nov 2006 14:22:23 +0000 Subject: [PATCH] in editable fields TALES context, 'cell' is the brain, not the object, otherwise no way to access brain attributes. This assumes that brain class supports acquisition in the context of the object. git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@11294 20353a03-c40f-0410-a6d1-a30d3c3de9de --- product/ERP5Form/ListBox.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/product/ERP5Form/ListBox.py b/product/ERP5Form/ListBox.py index f2500cad2b..b2b1ed249c 100644 --- a/product/ERP5Form/ListBox.py +++ b/product/ERP5Form/ListBox.py @@ -1797,6 +1797,7 @@ class ListBoxRendererLine: else: # This is an usual line. obj = self.getObject() + brain = self.getBrain() # Use a widget, if any. editable_field_id = '%s_%s' % (self.renderer.getId(), alias) @@ -1806,12 +1807,12 @@ class ListBoxRendererLine: editable_field = form.get_field(editable_field_id) tales = editable_field.tales.get('default', '') if tales: - original_value = editable_field.__of__(obj).get_value('default', cell = obj) + original_value = editable_field.__of__(obj).get_value('default', + cell=brain) processed_value = original_value # If a tales expression is not defined, get a skin, an accessor or a property. if not tales: - brain = self.getBrain() if hasattr(aq_self(brain), alias): original_value = getattr(brain, alias) processed_value = original_value -- 2.30.9