diff options
| author | Harry (Open ERP) <hmo@tinyerp.com> | 2010-04-23 17:35:44 +0530 |
|---|---|---|
| committer | Harry (Open ERP) <hmo@tinyerp.com> | 2010-04-23 17:35:44 +0530 |
| commit | 199ac22a962e89eee314254846cfbb95aaa6d99d (patch) | |
| tree | 3315d35692fa3f4e8d4f3ff03096c7b62848aa14 /addons/document_webdav | |
| parent | 65ed78ef9172300bdd03c02c27d8aed1c75fcebc (diff) | |
[FIX] caldav: remove calendar problem
bzr revid: hmo@tinyerp.com-20100423120544-axml2owg03rwwvv0
Diffstat (limited to 'addons/document_webdav')
| -rw-r--r-- | addons/document_webdav/dav_fs.py | 29 |
1 files changed, 7 insertions, 22 deletions
diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index bfe9729a194..0c2e52c8df7 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -433,6 +433,7 @@ class openerp_dav_handler(dav_interface): return 201 def rmcol(self,uri): + print ' REMOVE COLLL :::::', uri """ delete a collection """ if uri[-1]=='/':uri=uri[:-1] @@ -440,39 +441,23 @@ class openerp_dav_handler(dav_interface): if not dbname: # *-* raise DAV_Error, 409 node = self.uri2object(cr, uid, pool, uri2) - object = node.context._dirobj.browse(cr, uid, node.dir_id) - - if not object: - raise OSError(2, 'Not such file or directory.') - if object._table_name=='document.directory': - if node.children(cr): - raise OSError(39, 'Directory not empty.') - res = pool.get('document.directory').unlink(cr, uid, [object.id]) - else: - raise OSError(1, 'Operation not permited.') + node.rmcol(cr) cr.commit() cr.close() return 204 def rm(self,uri): - if uri[-1]=='/':uri=uri[:-1] - - object=False + print ' REMOVE EVENT :::::', uri + if uri[-1]=='/':uri=uri[:-1] cr, uid, pool,dbname, uri2 = self.get_cr(uri) if not dbname: cr.close() raise DAV_Error, 409 node = self.uri2object(cr,uid,pool, uri2) - object = pool.get('ir.attachment').browse(cr, uid, node.file_id) - self.parent.log_message(' rm %s "%s"'%(object._table_name,uri)) - if not object: - raise OSError(2, 'Not such file or directory.') - if object._table_name == 'ir.attachment': - res = pool.get('ir.attachment').unlink(cr, uid, [object.id]) - else: - raise OSError(1, 'Operation not permited.') - + res = node.rm(cr) + if not res: + raise OSError(1, 'Operation not permited.') cr.commit() cr.close() return 204 |
