From f47eae52203d4d43bc0e45ff3b2a094943f01118 Mon Sep 17 00:00:00 2001 From: "Jay (Open ERP)" Date: Tue, 29 Sep 2009 19:26:59 +0530 Subject: [PATCH] [REVERT] Document : BAD Fix jvo@tinyerp.com-20090925134942-y663miys2ocgwi56 bzr revid: jvo@tinyerp.com-20090929135659-3zf9j2m8a8py2qvx --- addons/document/document.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/addons/document/document.py b/addons/document/document.py index 4b1a5c715e3..460c52a9698 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -651,11 +651,11 @@ class document_file(osv.osv): def create(self, cr, uid, vals, context={}): vals['title']=vals['name'] vals['parent_id'] = context.get('parent_id',False) or vals.get('parent_id',False) -# if not vals.get('res_id', False) and context.get('default_res_id',False): -# vals['res_id']=context.get('default_res_id',False) -# if not vals.get('res_model', False) and context.get('default_res_model',False): -# vals['res_model']=context.get('default_res_model',False) - vals['res_model'] = "report.document.user" + if not vals.get('res_id', False) and context.get('default_res_id',False): + vals['res_id']=context.get('default_res_id',False) + if not vals.get('res_model', False) and context.get('default_res_model',False): + vals['res_model']=context.get('default_res_model',False) + if vals.get('res_id', False) and vals.get('res_model',False): obj_model=self.pool.get(vals['res_model']) result = obj_model.read(cr, uid, [vals['res_id']], context=context) @@ -695,7 +695,6 @@ class document_file(osv.osv): res = content_index(base64.decodestring(datas), vals['datas_fname'], vals.get('content_type', None)) super(document_file,self).write(cr, uid, [result], { 'index_content' : res, - 'res_id' : result }) cr.commit() except: