Commit 7c1fb3bc authored by Arnaud Fontaine's avatar Arnaud Fontaine

Likewise a non-ListBox field, call custom edit() if available (eg encapsulated editor).

For example, MultiRelationStringField does not return a plain value, but a
MultiRelationEditor overriding Base_edit default behavior.
parent 4fa84233
...@@ -117,15 +117,25 @@ def editListBox(listbox_field, listbox):\n ...@@ -117,15 +117,25 @@ def editListBox(listbox_field, listbox):\n
for url, v in listbox.items():\n for url, v in listbox.items():\n
v.update(gv)\n v.update(gv)\n
# Form: \'\' -> ERP5: None\n # Form: \'\' -> ERP5: None\n
cleaned_v = v.copy()\n encapsulated_editor_list = []\n
for key, value in cleaned_v.items():\n cleaned_v = {}\n
if value == \'\':\n for key, value in v.items():\n
cleaned_v[key] = None\n if hasattr(value, \'edit\'):\n
encapsulated_editor_list.append(value)\n
else:\n
if value == \'\': \n
value = None\n
cleaned_v[key] = value\n
\n
obj = context.restrictedTraverse(url)\n
if cleaned_v:\n if cleaned_v:\n
if listbox_edit is None:\n if listbox_edit is None:\n
context.restrictedTraverse(url).edit(edit_order=edit_order, **cleaned_v)\n obj.edit(edit_order=edit_order, **cleaned_v)\n
else:\n else:\n
listbox_edit(url, edit_order, cleaned_v)\n listbox_edit(url, edit_order, cleaned_v)\n
\n
for encapsulated_editor in encapsulated_editor_list:\n
encapsulated_editor.edit(obj)\n
\n \n
def editMatrixBox(matrixbox_field, matrixbox):\n def editMatrixBox(matrixbox_field, matrixbox):\n
""" Function called to edit a Matrix box\n """ Function called to edit a Matrix box\n
......
2014-01-27 arnaud.fontaine
* Likewise a non-ListBox field, call custom edit() if available (eg encapsulated editor). For example, MultiRelationStringField does not return a plain value, but a MultiRelationEditor overriding Base_edit default behavior.
2014-01-27 arnaud.fontaine 2014-01-27 arnaud.fontaine
* TemplateTool: Move BusinessTemplate ListBox field to hidden group (1c5578f). * TemplateTool: Move BusinessTemplate ListBox field to hidden group (1c5578f).
......
41149 41150
\ No newline at end of file \ No newline at end of file
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