mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-24 02:08:36 +00:00
[MIG] attachment_swift: Migration to 14.0
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
{'name': 'Attachments on Swift storage',
|
{'name': 'Attachments on Swift storage',
|
||||||
'summary': 'Store assets and attachments on a Swift compatible object store',
|
'summary': 'Store assets and attachments on a Swift compatible object store',
|
||||||
'version': '13.0.1.0.0',
|
'version': "14.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',
|
||||||
@@ -17,5 +17,5 @@
|
|||||||
},
|
},
|
||||||
'website': 'https://www.camptocamp.com',
|
'website': 'https://www.camptocamp.com',
|
||||||
'data': [],
|
'data': [],
|
||||||
'installable': False,
|
'installable': True,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ class IrAttachment(models.Model):
|
|||||||
return conn
|
return conn
|
||||||
|
|
||||||
@api.model
|
@api.model
|
||||||
def _store_file_read(self, fname, bin_size=False):
|
def _store_file_read(self, fname):
|
||||||
if fname.startswith('swift://'):
|
if fname.startswith('swift://'):
|
||||||
swifturi = SwiftUri(fname)
|
swifturi = SwiftUri(fname)
|
||||||
try:
|
try:
|
||||||
@@ -141,7 +141,7 @@ class IrAttachment(models.Model):
|
|||||||
'Error reading object from Swift object store')
|
'Error reading object from Swift object store')
|
||||||
return read
|
return read
|
||||||
else:
|
else:
|
||||||
return super()._store_file_read(fname, bin_size)
|
return super()._store_file_read(fname)
|
||||||
|
|
||||||
def _store_file_write(self, key, bin_data):
|
def _store_file_write(self, key, bin_data):
|
||||||
if self._storage() == 'swift':
|
if self._storage() == 'swift':
|
||||||
|
|||||||
Reference in New Issue
Block a user