mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
fix: instance definition
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user