diff options
| author | DBR (OpenERP) <dbr@tinyerp.com> | 2011-09-20 12:15:50 +0530 |
|---|---|---|
| committer | DBR (OpenERP) <dbr@tinyerp.com> | 2011-09-20 12:15:50 +0530 |
| commit | fa577c8a15ad327d77d4e9e24d5e0ea27ca3e613 (patch) | |
| tree | 96cfa22a87945b37b853b3e10b3a0f1944204666 /addons/document/document.py | |
| parent | 2380552cb493040b22e61f8e4209cc6df8edc912 (diff) | |
| parent | f2f072e2e3c9a273a050d6f2277beb64b1671e18 (diff) | |
[Merge]with: lp:openobject-addons
bzr revid: dbr@tinyerp.com-20110920064550-v90yjoblpzp5ebiq
Diffstat (limited to 'addons/document/document.py')
| -rw-r--r-- | addons/document/document.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/document/document.py b/addons/document/document.py index 69e123b87eb..774c4e53a80 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -64,7 +64,7 @@ class document_file(osv.osv): "SET parent_id = %s, db_datas = decode(encode(db_datas,'escape'), 'base64') " \ "WHERE parent_id IS NULL", (parent_id,)) - cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0;") + cr.execute("UPDATE ir_attachment SET file_size=length(db_datas) WHERE file_size = 0 and type = 'binary'") cr.execute("ALTER TABLE ir_attachment ALTER parent_id SET NOT NULL") @@ -252,7 +252,7 @@ class document_file(osv.osv): ids = ids2 if 'file_size' in vals: # only write that field using direct SQL calls del vals['file_size'] - if len(ids) and len(vals): + if ids and vals: result = super(document_file,self).write(cr, uid, ids, vals, context=context) cr.commit() # ? return result |
