[FIX] document : create doc of any resource model with black name

lp bug: https://launchpad.net/bugs/404975 fixed

bzr revid: hmo@tinyerp.com-20090803104440-y65u4102ym2e4m68
This commit is contained in:
Harry (Open ERP)
2009-08-03 16:14:40 +05:30
parent a305b1a2ca
commit 141b65107f
+2 -1
View File
@@ -667,7 +667,8 @@ 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.get('name',''))[:60]
if obj.get('name',False):
vals['title'] = (obj.get('name',''))[:60]
if obj_model._name=='res.partner':
vals['partner_id']=obj['id']
elif obj.get('address_id',False):