From df40ff60dcabc12c3d806ce6715097f4290087a1 Mon Sep 17 00:00:00 2001 From: "P. Christeas" Date: Wed, 23 Jun 2010 17:07:09 +0300 Subject: [PATCH] Document: fix creating of empty files. For an empty file, the interface (eg. webdav) could ask to create with data=None. Allow that. bzr revid: p_christ@hol.gr-20100623140709-m11r40kk2dl9okvo --- addons/document/nodes.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/document/nodes.py b/addons/document/nodes.py index df1878ad798..299e2a84330 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -339,7 +339,8 @@ class node_dir(node_database): fil_id = fil_obj.create(cr, uid, val, context=ctx) fil = fil_obj.browse(cr, uid, fil_id, context=ctx) fnode = node_file(path, self, self.context, fil) - fnode.set_data(cr, data, fil) + if data is not None: + fnode.set_data(cr, data, fil) return fnode def get_etag(self, cr):