diff --git a/base_dav/models/dav_collection.py b/base_dav/models/dav_collection.py index 2e0ee1aa..c98e5320 100644 --- a/base_dav/models/dav_collection.py +++ b/base_dav/models/dav_collection.py @@ -172,7 +172,7 @@ class DavCollection(models.Model): )) @api.multi - def dav_list(self, path_components): + def dav_list(self, collection, path_components): self.ensure_one() if self.dav_type == 'files': @@ -215,7 +215,7 @@ class DavCollection(models.Model): return result @api.multi - def dav_delete(self, components): + def dav_delete(self, collection, components): self.ensure_one() if self.dav_type == "files": @@ -225,7 +225,7 @@ class DavCollection(models.Model): self.get_record(components).unlink() @api.multi - def dav_upload(self, href, item): + def dav_upload(self, collection, href, item): self.ensure_one() components = self._split_path(href) @@ -248,14 +248,14 @@ class DavCollection(models.Model): record.write(data) return Item( - self, + collection, item=self.to_vobject(record), href=href, last_modified=self._odoo_to_http_datetime(record.write_date), ) @api.multi - def dav_get(self, href): + def dav_get(self, collection, href): self.ensure_one() components = self._split_path(href) @@ -279,7 +279,7 @@ class DavCollection(models.Model): ('name', '=', components[3]), ], limit=1) return FileItem( - self, + collection, item=attachment, href=href, last_modified=self._odoo_to_http_datetime( @@ -293,7 +293,7 @@ class DavCollection(models.Model): return None return Item( - self, + collection, item=self.to_vobject(record), href=href, last_modified=self._odoo_to_http_datetime(record.write_date), diff --git a/base_dav/radicale/collection.py b/base_dav/radicale/collection.py index 9a37c5bf..0fe39abe 100644 --- a/base_dav/radicale/collection.py +++ b/base_dav/radicale/collection.py @@ -120,13 +120,13 @@ class Collection(BaseCollection): self.logger.warning('unsupported metadata %s', key) def get(self, href): - return self.collection.dav_get(href) + return self.collection.dav_get(self, href) def upload(self, href, vobject_item): - return self.collection.dav_upload(href, vobject_item) + return self.collection.dav_upload(self, href, vobject_item) def delete(self, href): - return self.collection.dav_delete(self._split_path(href)) + return self.collection.dav_delete(self, self._split_path(href)) def list(self): - return self.collection.dav_list(self.path_components) + return self.collection.dav_list(self, self.path_components)