diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index df9807c..9d54873 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -56,7 +56,7 @@ repos: - id: oca-gen-addon-readme args: - --addons-dir=. - - --branch=17.0 + - --branch=18.0 - --org-name=camptocamp - --repo-name=odoo-cloud-platform - --if-source-changed diff --git a/base_attachment_object_storage/__init__.py b/base_attachment_object_storage/__init__.py index 1e8071d..899bcc9 100644 --- a/base_attachment_object_storage/__init__.py +++ b/base_attachment_object_storage/__init__.py @@ -1,26 +1,2 @@ from . import models -from odoo.http import Stream - -old_from_attachment = Stream.as_attachment - - -@classmethod -def from_attachment(cls, attachment): - if attachment.store_fname and attachment._is_file_from_a_store( - attachment.store_fname - ): - self = cls( - mimetype=attachment.mimetype, - download_name=attachment.name, - conditional=True, - etag=attachment.checksum, - ) - self.type = "data" - self.data = attachment.raw - self.size = len(self.data) - return self - return old_from_attachment(attachment) - - -Stream.as_attachment = from_attachment