summaryrefslogtreecommitdiff
path: root/addons/document/document_storage.py
diff options
context:
space:
mode:
authorHarry (Open ERP) <hmo@tinyerp.com>2009-12-08 19:00:41 +0530
committerHarry (Open ERP) <hmo@tinyerp.com>2009-12-08 19:00:41 +0530
commit307898c2a8152de4dabdce9a90a37f1412d74d80 (patch)
tree7c5d0878c745d40914016502316b063ef35c6b3e /addons/document/document_storage.py
parent84898328030e9172ce759067fe28a91d7210a49f (diff)
[FIX] document: fixed problem on mkdir, remove, create file, rename
bzr revid: hmo@tinyerp.com-20091208133041-ikpo3by8r8xbrthb
Diffstat (limited to 'addons/document/document_storage.py')
-rw-r--r--addons/document/document_storage.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py
index 488a5ee7e6c..54e4ad3f9cf 100644
--- a/addons/document/document_storage.py
+++ b/addons/document/document_storage.py
@@ -190,11 +190,12 @@ class document_storage(osv.osv):
path = boo.path
try:
flag = None
- # This can be improved
- for dirs in os.listdir(path):
- if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
- flag = dirs
- break
+ # This can be improved
+ if os.path.isdir(path):
+ for dirs in os.listdir(path):
+ if os.path.isdir(os.path.join(path,dirs)) and len(os.listdir(os.path.join(path,dirs)))<4000:
+ flag = dirs
+ break
flag = flag or create_directory(path)
filename = random_name()
fname = os.path.join(path, flag, filename)