diff --git a/attachment_swift/README.rst b/attachment_swift/README.rst new file mode 100644 index 0000000..e69de29 diff --git a/attachment_swift/__init__.py b/attachment_swift/__init__.py new file mode 100644 index 0000000..bff786c --- /dev/null +++ b/attachment_swift/__init__.py @@ -0,0 +1 @@ +import models diff --git a/attachment_swift/__manifest__.py b/attachment_swift/__manifest__.py new file mode 100644 index 0000000..db3371f --- /dev/null +++ b/attachment_swift/__manifest__.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 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 storage', + 'version': '10.0.0.0', + 'author': 'Camptocamp,Odoo Community Association (OCA)', + 'license': 'AGPL-3', + 'category': 'Knowledge Management', + 'depends': ['base'], + 'website': 'http://www.camptocamp.com', + 'data': [], + 'installable': True, + } diff --git a/attachment_swift/models/__init__.py b/attachment_swift/models/__init__.py new file mode 100644 index 0000000..aaf38a1 --- /dev/null +++ b/attachment_swift/models/__init__.py @@ -0,0 +1 @@ +from . import ir_attachment diff --git a/attachment_swift/models/ir_attachment.py b/attachment_swift/models/ir_attachment.py new file mode 100644 index 0000000..f5bd7da --- /dev/null +++ b/attachment_swift/models/ir_attachment.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 Camptocamp SA +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + + +import logging +from odoo import api, models + +_logger = logging.getLogger(__name__) + + +class IrAttachment(models.Model): + _inherit = 'ir.attachment' + + @api.model + def _file_write(self, value, checksum): + _logger.debug('Writing a file :)') + filename = super(IrAttachment, self)._file_write(value, checksum) + return filename diff --git a/requirements.txt b/requirements.txt index 5dfb4b8..51a2bd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ boto==2.42.0 redis==2.10.5 python-json-logger==0.1.5 statsd==3.2.1 +python-swiftclient==3.0.0