summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorHarry (Open ERP) <hmo@tinyerp.com>2010-03-18 21:00:43 +0530
committerHarry (Open ERP) <hmo@tinyerp.com>2010-03-18 21:00:43 +0530
commita87d74b385a64ee3409b134ddc3aed00a338f35f (patch)
tree5d5054fdb0241cbdf43bb30bf5699695cc1b0aff /addons
parent44e3d58bc49d1ce1126545da8caa02b0b35abf8f (diff)
[FIX] dms: if file does not has any direcotry on creation, take root directory
bzr revid: hmo@tinyerp.com-20100318153043-32ict1bcx08pe704
Diffstat (limited to 'addons')
-rw-r--r--addons/document/document.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/addons/document/document.py b/addons/document/document.py
index 375f24cd62a..f3ffd2f6f6c 100644
--- a/addons/document/document.py
+++ b/addons/document/document.py
@@ -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):