summaryrefslogtreecommitdiff
path: root/addons/document/document.py
diff options
context:
space:
mode:
authorJay (Open ERP) <jvo@tinyerp.com>2009-09-29 19:26:59 +0530
committerJay (Open ERP) <jvo@tinyerp.com>2009-09-29 19:26:59 +0530
commitf47eae52203d4d43bc0e45ff3b2a094943f01118 (patch)
tree011d3aee4c646e77cd37d3d7e3f128c5274159e6 /addons/document/document.py
parent34645503b72e0e7196f98f0ebca0902009afddba (diff)
[REVERT] Document : BAD Fix jvo@tinyerp.com-20090925134942-y663miys2ocgwi56
bzr revid: jvo@tinyerp.com-20090929135659-3zf9j2m8a8py2qvx
Diffstat (limited to 'addons/document/document.py')
-rw-r--r--addons/document/document.py11
1 files 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: