diff options
| author | Kirti Savalia (OpenERP) <ksa@tinyerp.com> | 2011-10-10 14:26:18 +0530 |
|---|---|---|
| committer | Kirti Savalia (OpenERP) <ksa@tinyerp.com> | 2011-10-10 14:26:18 +0530 |
| commit | 2ef34dc37b59eab1008460dba73b4b0daabaec41 (patch) | |
| tree | 2d81af1eeee9b4a55f098e62623ae240409d6529 /addons/document/document.py | |
| parent | a225afcb9fd7cb36dac48c6a9bceacdaa2db79ab (diff) | |
| parent | 4adcbde35274e0ffbd53201ac388d379e330aa08 (diff) | |
[MERGE]:with latest addons
bzr revid: ksa@tinyerp.com-20111010085618-kbc3r13vqajoq0un
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 |
