Commit 79797430 authored by Jérome Perrin's avatar Jérome Perrin

in editable fields TALES context, 'cell' is the brain, not the object,...

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
parent a029d3e2
...@@ -1797,6 +1797,7 @@ class ListBoxRendererLine: ...@@ -1797,6 +1797,7 @@ class ListBoxRendererLine:
else: else:
# This is an usual line. # This is an usual line.
obj = self.getObject() obj = self.getObject()
brain = self.getBrain()
# Use a widget, if any. # Use a widget, if any.
editable_field_id = '%s_%s' % (self.renderer.getId(), alias) editable_field_id = '%s_%s' % (self.renderer.getId(), alias)
...@@ -1806,12 +1807,12 @@ class ListBoxRendererLine: ...@@ -1806,12 +1807,12 @@ class ListBoxRendererLine:
editable_field = form.get_field(editable_field_id) editable_field = form.get_field(editable_field_id)
tales = editable_field.tales.get('default', '') tales = editable_field.tales.get('default', '')
if tales: 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 processed_value = original_value
# If a tales expression is not defined, get a skin, an accessor or a property. # If a tales expression is not defined, get a skin, an accessor or a property.
if not tales: if not tales:
brain = self.getBrain()
if hasattr(aq_self(brain), alias): if hasattr(aq_self(brain), alias):
original_value = getattr(brain, alias) original_value = getattr(brain, alias)
processed_value = original_value processed_value = original_value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment