[Erp5-report] r39882 jerome - in /erp5/trunk/products/ERP5/bootstrap/erp5_core: SkinTemplat...

nobody at svn.erp5.org nobody at svn.erp5.org
Thu Nov 4 10:00:42 CET 2010


Author: jerome
Date: Thu Nov  4 10:00:37 2010
New Revision: 39882

URL: http://svn.erp5.org?rev=39882&view=rev
Log:
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.

Modified:
    erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.xml
    erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.xml
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.xml?rev=39882&r1=39881&r2=39882&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.xml [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/SkinTemplateItem/portal_skins/erp5_core/Base_edit.xml [utf8] Thu Nov  4 10:00:37 2010
@@ -116,7 +116,12 @@ def editListBox(listbox_field, listbox):
         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, matri
                 # 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

Modified: erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision?rev=39882&r1=39881&r2=39882&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] (original)
+++ erp5/trunk/products/ERP5/bootstrap/erp5_core/bt/revision [utf8] Thu Nov  4 10:00:37 2010
@@ -1 +1 @@
-1770
\ No newline at end of file
+1771
\ No newline at end of file




More information about the Erp5-report mailing list