mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Merge pull request #82 from Tonow-c2c/BSRD-286_MIG-13.0_attachment_s3
Bsrd 286 mig 13.0 attachment s3
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
|
||||||
{'name': 'Attachments on S3 storage',
|
{'name': 'Attachments on S3 storage',
|
||||||
'summary': 'Store assets and attachments on a S3 compatible object storage',
|
'summary': 'Store assets and attachments on a S3 compatible object storage',
|
||||||
'version': '12.0.1.0.0',
|
'version': '13.0.1.0.0',
|
||||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||||
'license': 'AGPL-3',
|
'license': 'AGPL-3',
|
||||||
'category': 'Knowledge Management',
|
'category': 'Knowledge Management',
|
||||||
@@ -14,5 +14,5 @@
|
|||||||
},
|
},
|
||||||
'website': 'https://www.camptocamp.com',
|
'website': 'https://www.camptocamp.com',
|
||||||
'data': [],
|
'data': [],
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
|
|
||||||
@@ -28,7 +28,7 @@ class IrAttachment(models.Model):
|
|||||||
|
|
||||||
def _get_stores(self):
|
def _get_stores(self):
|
||||||
l = ['s3']
|
l = ['s3']
|
||||||
l += super(IrAttachment, self)._get_stores()
|
l += super()._get_stores()
|
||||||
return l
|
return l
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
@@ -133,7 +133,7 @@ class IrAttachment(models.Model):
|
|||||||
)
|
)
|
||||||
return read
|
return read
|
||||||
else:
|
else:
|
||||||
return super(IrAttachment, self)._store_file_read(fname, bin_size)
|
return super()._store_file_read(fname, bin_size)
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _store_file_write(self, key, bin_data):
|
def _store_file_write(self, key, bin_data):
|
||||||
@@ -156,7 +156,7 @@ class IrAttachment(models.Model):
|
|||||||
_('The file could not be stored: %s') % str(error)
|
_('The file could not be stored: %s') % str(error)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
_super = super(IrAttachment, self)
|
_super = super()
|
||||||
filename = _super._store_file_write(key, bin_data)
|
filename = _super._store_file_write(key, bin_data)
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
@@ -186,4 +186,4 @@ class IrAttachment(models.Model):
|
|||||||
'Error during deletion of the file %s' % fname
|
'Error during deletion of the file %s' % fname
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
super(IrAttachment, self)._store_file_delete(fname)
|
super()._store_file_delete(fname)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# Copyright 2016-2018 Camptocamp SA
|
# Copyright 2016-2019 Camptocamp SA
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|||||||
Reference in New Issue
Block a user