summaryrefslogtreecommitdiff
path: root/addons/document/nodes.py
diff options
context:
space:
mode:
authorP. Christeas <p_christ@hol.gr>2010-10-27 13:23:23 +0300
committerP. Christeas <p_christ@hol.gr>2010-10-27 13:23:23 +0300
commitc3b4dba6713b7dc987f5e4a1bc4780392bd4903a (patch)
treeb624c1caa1b39bda20f3a237875ba06b64e2077e /addons/document/nodes.py
parent7628e1e4330443ef15b48106c1e2c1b84ce6e4e3 (diff)
Document: by default N/I functions raise IO error.
Attempting to create a file or folder at nodes that don't support it, should be reported as a permission error. bzr revid: p_christ@hol.gr-20101027102323-3l15biqitaryqelb
Diffstat (limited to 'addons/document/nodes.py')
-rw-r--r--addons/document/nodes.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/document/nodes.py b/addons/document/nodes.py
index 089cde3e41a..d32ccf49440 100644
--- a/addons/document/nodes.py
+++ b/addons/document/nodes.py
@@ -366,12 +366,14 @@ class node_class(object):
def create_child(self, cr, path, data=None):
""" Create a regular file under this node
"""
- raise NotImplementedError(repr(self))
+ logger.warning("Attempted to create a file under %r, not possible.", self)
+ raise IOError(errno.EPERM, "Not allowed to create files here")
def create_child_collection(self, cr, objname):
""" Create a child collection (directory) under self
"""
- raise NotImplementedError(repr(self))
+ logger.warning("Attempted to create a collection under %r, not possible.", self)
+ raise IOError(errno.EPERM, "Not allowed to create folders here")
def rm(self, cr):
raise NotImplementedError(repr(self))