[MIG] attachment_swift: Migration to 14.0

This commit is contained in:
Patrick Tombez
2020-11-03 15:30:48 +01:00
parent 049205e560
commit 3655bce3ae
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -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,
} }
+2 -2
View File
@@ -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':