Commit 4bd76a43 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Use get_recursive_tales (for ProxyField) or get_tales (for the others) to see...

Use get_recursive_tales (for ProxyField) or get_tales (for the others) to see if a tales expression is defined. Otherwise, a delegated one is ignored.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33304 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 8af8a788
...@@ -2113,7 +2113,13 @@ class ListBoxRendererLine: ...@@ -2113,7 +2113,13 @@ class ListBoxRendererLine:
editable_field = renderer.getEditableField(alias) editable_field = renderer.getEditableField(alias)
tales = False tales = False
if editable_field is not None: if editable_field is not None:
tales = editable_field.tales.get('default', '') # XXX we need to take care of whether the editable field is
# a proxy field or not, because a proxy field may inherit a
# tales expression from a template field, and the API is not
# unified.
get_tales = getattr(editable_field, 'get_recursive_tales',
editable_field.get_tales)
tales = get_tales('default')
if tales: if tales:
obj = self.getObject() obj = self.getObject()
original_value = editable_field.__of__(obj).get_value('default', original_value = editable_field.__of__(obj).get_value('default',
...@@ -2703,7 +2709,6 @@ class ListBoxValidator(Validator.Validator): ...@@ -2703,7 +2709,6 @@ class ListBoxValidator(Validator.Validator):
my_field = form.get_field(my_field_id) my_field = form.get_field(my_field_id)
REQUEST.set('cell', o) # We need cell REQUEST.set('cell', o) # We need cell
if my_field.get_value('editable', REQUEST=REQUEST) and field.need_validate(REQUEST): if my_field.get_value('editable', REQUEST=REQUEST) and field.need_validate(REQUEST):
tales_expr = my_field.tales.get('default', "")
error_result_key = '%s_%s' % (my_field.id, o.uid) error_result_key = '%s_%s' % (my_field.id, o.uid)
key = 'field_' + error_result_key key = 'field_' + error_result_key
try: try:
......
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