Commit 2e022d91 authored by Jérome Perrin's avatar Jérome Perrin

In base edit, we translate '' to None before passing the kw to edit. This was...

In base edit, we translate '' to None before passing the kw to edit. This was done only for main fields, but not for listbox/matrixbox editable field. This commit makes the behaviour consistent by applying the same translation to listbox and matrixbox.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39882 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent c98150ff
......@@ -116,7 +116,12 @@ def editListBox(listbox_field, listbox):\n
gv[k] = getattr(request, k, None)\n
for url, v in listbox.items():\n
v.update(gv)\n
context.restrictedTraverse(url).edit(edit_order=edit_order, **v)\n
# Form: \'\' -> ERP5: None\n
cleaned_v = v.copy()\n
for key, value in cleaned_v.items():\n
if value == \'\':\n
cleaned_v[key] = None\n
context.restrictedTraverse(url).edit(edit_order=edit_order, **cleaned_v)\n
\n
def editMatrixBox(matrixbox_field, matrixbox):\n
""" Function called to edit a Matrix box\n
......@@ -208,7 +213,12 @@ def editMatrixBox(matrixbox_field, matrixbox):\n
# XXX May require some changes with Sets\n
key = gv[\'mapped_value_property_list\'][0]\n
v[key] = value\n
c.edit(edit_order=edit_order, **v) # and update the cell specific values\n
# Form: \'\' -> ERP5: None\n
cleaned_v = v.copy()\n
for key, value in cleaned_v.items():\n
if value == \'\':\n
cleaned_v[key] = None\n
c.edit(edit_order=edit_order, **cleaned_v) # and update the cell specific values\n
else:\n
return "Could not create cell %s" % str(k)\n
else:\n
......
1770
\ No newline at end of file
1771
\ 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