fix: instance definition

This commit is contained in:
vrenaville
2025-01-06 14:43:59 +01:00
parent 219a9a305f
commit 47f0ea743b
2 changed files with 1 additions and 25 deletions
+1 -1
View File
@@ -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
@@ -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