mirror of
https://github.com/camptocamp/odoo-cloud-platform.git
synced 2026-06-23 18:04:34 +00:00
Merge pull request #85 from Tonow-c2c/BSRD-286_MIG-13.0_attachment_swift
Bsrd 286 mig 13.0 attachment swift
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
# Copyright 2017-2018 Camptocamp SA
|
||||
# Copyright 2017-2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
|
||||
{'name': 'Attachments on Swift storage',
|
||||
'summary': 'Store assets and attachments on a Swift compatible object store',
|
||||
'version': '12.0.1.0.0',
|
||||
'version': '13.0.1.0.0',
|
||||
'author': 'Camptocamp,Odoo Community Association (OCA)',
|
||||
'license': 'AGPL-3',
|
||||
'category': 'Knowledge Management',
|
||||
@@ -17,5 +17,5 @@
|
||||
},
|
||||
'website': 'https://www.camptocamp.com',
|
||||
'data': [],
|
||||
'installable': False,
|
||||
'installable': True,
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2018 Camptocamp SA
|
||||
# Copyright 2017-2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ class IrAttachment(models.Model):
|
||||
|
||||
def _get_stores(self):
|
||||
l = ['swift']
|
||||
l += super(IrAttachment, self)._get_stores()
|
||||
l += super()._get_stores()
|
||||
return l
|
||||
|
||||
@api.model
|
||||
@@ -133,7 +133,7 @@ class IrAttachment(models.Model):
|
||||
'Error reading object from Swift object store')
|
||||
return read
|
||||
else:
|
||||
return super(IrAttachment, self)._store_file_read(fname, bin_size)
|
||||
return super()._store_file_read(fname, bin_size)
|
||||
|
||||
def _store_file_write(self, key, bin_data):
|
||||
if self._storage() == 'swift':
|
||||
@@ -147,7 +147,7 @@ class IrAttachment(models.Model):
|
||||
_logger.exception('Error writing to Swift object store')
|
||||
raise exceptions.UserError(_('Error writing to Swift'))
|
||||
else:
|
||||
_super = super(IrAttachment, self)
|
||||
_super = super()
|
||||
filename = _super._store_file_write(key, bin_data)
|
||||
return filename
|
||||
|
||||
@@ -168,4 +168,4 @@ class IrAttachment(models.Model):
|
||||
# we ignore the error, file will stay on the object
|
||||
# storage but won't disrupt the process
|
||||
else:
|
||||
super(IrAttachment, self)._file_delete_from_store(fname)
|
||||
super()._file_delete_from_store(fname)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2018 Camptocamp SA
|
||||
# Copyright 2017-2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
import re
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2018 Camptocamp SA
|
||||
# Copyright 2017-2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
import base64
|
||||
@@ -17,7 +17,7 @@ from odoo.addons.attachment_swift.swift_uri import SwiftUri
|
||||
class TestAttachmentSwift(TestIrAttachment):
|
||||
|
||||
def setup(self):
|
||||
super(TestAttachmentSwift, self).setUp()
|
||||
super().setUp()
|
||||
self.env['ir.config_parameter'].set_param('ir_attachment.location',
|
||||
'swift')
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# Copyright 2017-2018 Camptocamp SA
|
||||
# Copyright 2017-2019 Camptocamp SA
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
|
||||
|
||||
from odoo.addons.base.tests.test_ir_attachment import TestIrAttachment
|
||||
@@ -12,7 +12,7 @@ class TestAttachmentSwift(TestIrAttachment):
|
||||
"""
|
||||
|
||||
def setup(self):
|
||||
super(TestAttachmentSwift, self).setUp()
|
||||
super().setUp()
|
||||
self.env['ir.config_parameter'].set_param('ir_attachment.location',
|
||||
'swift')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user