mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
fix: instance definition
This commit is contained in:
@@ -56,7 +56,7 @@ repos:
|
|||||||
- id: oca-gen-addon-readme
|
- id: oca-gen-addon-readme
|
||||||
args:
|
args:
|
||||||
- --addons-dir=.
|
- --addons-dir=.
|
||||||
- --branch=17.0
|
- --branch=18.0
|
||||||
- --org-name=camptocamp
|
- --org-name=camptocamp
|
||||||
- --repo-name=odoo-cloud-platform
|
- --repo-name=odoo-cloud-platform
|
||||||
- --if-source-changed
|
- --if-source-changed
|
||||||
|
|||||||
@@ -1,26 +1,2 @@
|
|||||||
from . import models
|
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