From 4b4b92cb4527a2d929d15c93220589a3af81a404 Mon Sep 17 00:00:00 2001 From: Tonow-c2c Date: Mon, 7 Oct 2019 14:58:39 +0200 Subject: [PATCH] BSRD-286: MIG V13 attachement_swift --- attachment_swift/__manifest__.py | 6 +++--- attachment_swift/models/ir_attachment.py | 10 +++++----- attachment_swift/swift_uri.py | 2 +- attachment_swift/tests/test_mock_swift_api.py | 4 ++-- attachment_swift/tests/test_with_swift_store.py | 4 ++-- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/attachment_swift/__manifest__.py b/attachment_swift/__manifest__.py index e5fa828..5447cfb 100644 --- a/attachment_swift/__manifest__.py +++ b/attachment_swift/__manifest__.py @@ -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, } diff --git a/attachment_swift/models/ir_attachment.py b/attachment_swift/models/ir_attachment.py index 9a41ce6..e145061 100644 --- a/attachment_swift/models/ir_attachment.py +++ b/attachment_swift/models/ir_attachment.py @@ -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) diff --git a/attachment_swift/swift_uri.py b/attachment_swift/swift_uri.py index 05bb8ee..fdd7ef4 100644 --- a/attachment_swift/swift_uri.py +++ b/attachment_swift/swift_uri.py @@ -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 diff --git a/attachment_swift/tests/test_mock_swift_api.py b/attachment_swift/tests/test_mock_swift_api.py index abc9a78..50b2691 100644 --- a/attachment_swift/tests/test_mock_swift_api.py +++ b/attachment_swift/tests/test_mock_swift_api.py @@ -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') diff --git a/attachment_swift/tests/test_with_swift_store.py b/attachment_swift/tests/test_with_swift_store.py index b3dd417..e46ba41 100644 --- a/attachment_swift/tests/test_with_swift_store.py +++ b/attachment_swift/tests/test_with_swift_store.py @@ -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')