From 2e7ed65dd29763d8652043822541de55ec15d553 Mon Sep 17 00:00:00 2001
From: Fabien Morin <fabien@nexedi.com>
Date: Wed, 4 Aug 2010 15:42:43 +0000
Subject: [PATCH] Do not errase dict if the new property is empty. Set the new
 property only it there is a value related to it. This way we keep less
 pirioritary result in  case the more prioritary is empty, but at least we
 have a result.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@37481 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/Document.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/Document/Document.py b/product/ERP5/Document/Document.py
index e0db815534..c6b9bfa081 100644
--- a/product/ERP5/Document/Document.py
+++ b/product/ERP5/Document/Document.py
@@ -753,7 +753,10 @@ class Document(DocumentExtensibleTraversableMixin, XMLObject, UrlMixIn, CachedCo
       else:
         result = method()
       if result is not None:
-        kw.update(result)
+      if result is not None:
+        for key, value in result.iteritems():
+          if value not in (None, ''):
+            kw[key]=value
 
     if file_name is not None:
       # filename is often undefined....
-- 
2.30.9