From 48e5b1b8b7cf652090e82f94bc96704053ff0283 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier <> Date: Tue, 9 Aug 2011 17:45:53 +0530 Subject: [FIX] document : Migration of url attachments lp bug: https://launchpad.net/bugs/809745 fixed bzr revid: dbr@tinyerp.com-20110809121553-sow9vfchkuc7du1u --- addons/document/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 69e123b87eb..b4a43fffa99 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") -- cgit v1.2.3 From 28986d87fbd14f2b7eb5f560a668f738322cf74d Mon Sep 17 00:00:00 2001 From: "Amit Parmar (OpenERP)" Date: Mon, 12 Sep 2011 18:21:06 +0530 Subject: [IMP] improve the opportunity merging and its attachments bzr revid: aar@tinyerp.com-20110912125106-xmh53poxaytd4frt --- addons/document/document.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/document/document.py') diff --git a/addons/document/document.py b/addons/document/document.py index 69e123b87eb..ef9ca01bd1e 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -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 -- cgit v1.2.3