[FIX] Document : error on create if attachment not specified
bzr revid: jvo@tinyerp.com-20090828111159-yoe862iefxw2h3uo
This commit is contained in:
@@ -695,8 +695,9 @@ class document_file(osv.osv):
|
||||
import urllib
|
||||
datas=base64.encodestring(urllib.urlopen(vals['link']).read())
|
||||
else:
|
||||
datas=vals.get('datas',False)
|
||||
vals['file_size']= len(datas)
|
||||
datas = vals.get('datas',False)
|
||||
|
||||
vals['file_size']= datas and len(datas) or 0
|
||||
if not self._check_duplication(cr,uid,vals):
|
||||
raise except_orm(_('ValidateError'), _('File name must be unique!'))
|
||||
result = super(document_file,self).create(cr, uid, vals, context)
|
||||
|
||||
Reference in New Issue
Block a user