From 861441e0d18f71f35572f801f4688142ec8c4197 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Aur=C3=A9lien=20Calonne?= <aurel@nexedi.com>
Date: Tue, 12 Jan 2016 10:53:21 +0100
Subject: [PATCH] do not raise when value is optional and value is not of the
 wanted type

this restore the behaviour of the code before commit 8e0737894e8eb4bd7eaebda0397335870e8a2fa9
---
 product/ERP5Type/patches/sqlvar.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/product/ERP5Type/patches/sqlvar.py b/product/ERP5Type/patches/sqlvar.py
index 103245e956..aeb1a12484 100644
--- a/product/ERP5Type/patches/sqlvar.py
+++ b/product/ERP5Type/patches/sqlvar.py
@@ -77,6 +77,8 @@ def SQLVar_render(self, md):
         #v="'%s'" % v
         return v
 
+    if args.get('optional'):
+        return 'null'
     raise ValueError('Invalid %s value for <em>%s</em>: %r'
                      % (t, self.__name__, v))
 
-- 
2.30.9