From 26aca254b99bae2fdff67bc2cd67494797f83ccc Mon Sep 17 00:00:00 2001 From: "Harry (Open ERP)" Date: Wed, 1 Jul 2009 14:26:13 +0530 Subject: [PATCH] [FIX] file attachment bug in x_object bzr revid: hmo@tinyerp.com-20090701085613-uiuufqoix2ldo8o8 --- addons/document/document.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 0d33efc5a1c..d5b61cae1f4 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -196,7 +196,7 @@ class node_class(object): else: for r in res: - if not r.name: + if not len(obj.fields_get(self.cr, self.uid, ['name'])): r.name = name_for+'%d'%r.id for invalid in INVALID_CHARS: if r.name.find(invalid) : @@ -648,7 +648,7 @@ class document_file(osv.osv): result = obj_model.read(cr, uid, [vals['res_id']], context=context) if len(result): obj=result[0] - vals['title'] = (obj['name'] or '')[:60] + vals['title'] = (obj.get('name',''))[:60] if obj_model._name=='res.partner': vals['partner_id']=obj['id'] elif obj.get('address_id',False):