[FIX] dms: if file does not has any direcotry on creation, take root directory

bzr revid: hmo@tinyerp.com-20100318153043-32ict1bcx08pe704
This commit is contained in:
Harry (Open ERP)
2010-03-18 21:00:43 +05:30
parent 44e3d58bc4
commit a87d74b385
+2
View File
@@ -157,6 +157,8 @@ class document_file(osv.osv):
context = {}
vals['title'] = vals['name']
vals['parent_id'] = context.get('parent_id', False) or vals.get('parent_id', False)
if not vals['parent_id']:
vals['parent_id'] = self.pool.get('document.directory')._get_root_directory(cr,uid, context)
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):