diff --git a/attachment_preview/README.rst b/attachment_preview/README.rst index c65b0349..dc01b4f8 100644 --- a/attachment_preview/README.rst +++ b/attachment_preview/README.rst @@ -1,6 +1,6 @@ -=================== -Preview attachments -=================== +================== +Attachment Preview +================== .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! @@ -14,18 +14,18 @@ Preview attachments :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github - :target: https://github.com/OCA/knowledge/tree/11.0/attachment_preview + :target: https://github.com/OCA/knowledge/tree/12.0/attachment_preview :alt: OCA/knowledge .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/knowledge-11-0/knowledge-11-0-attachment_preview + :target: https://translation.odoo-community.org/projects/knowledge-12-0/knowledge-12-0-attachment_preview :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/118/11.0 + :target: https://runbot.odoo-community.org/runbot/118/12.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| -This addon allows to preview attachments supported by http://viewerjs.org. +This module allows to preview attachments supported by http://viewerjs.org. Currently, that's most Libreoffice files and PDFs. @@ -44,7 +44,7 @@ Installation For filetype recognition, you'll get the best results by installing ``python-magic``: -sudo apt-get install python-magic +sudo apt-get install python3-magic Usage ===== @@ -64,7 +64,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -86,8 +86,8 @@ Contributors Other credits ~~~~~~~~~~~~~ -Addon icon ----------- +Module icon +----------- * courtesy of http://commons.wikimedia.org/wiki/Crystal_Clear @@ -104,6 +104,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/knowledge `_ project on GitHub. +This module is part of the `OCA/knowledge `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attachment_preview/__init__.py b/attachment_preview/__init__.py index 5b89c089..69f7babd 100644 --- a/attachment_preview/__init__.py +++ b/attachment_preview/__init__.py @@ -1,4 +1,3 @@ -# Copyright 2014 Therp BV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models diff --git a/attachment_preview/__manifest__.py b/attachment_preview/__manifest__.py index 77da9c13..63d5c710 100644 --- a/attachment_preview/__manifest__.py +++ b/attachment_preview/__manifest__.py @@ -2,8 +2,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - "name": "Preview attachments", - "version": "11.0.1.3.0", + "name": "Attachment Preview", + "version": "12.0.1.0.0", "author": "Therp BV," "Onestein," "Odoo Community Association (OCA)", diff --git a/attachment_preview/models/__init__.py b/attachment_preview/models/__init__.py index 22aa81fb..aee1fe67 100644 --- a/attachment_preview/models/__init__.py +++ b/attachment_preview/models/__init__.py @@ -1,4 +1,3 @@ -# Copyright 2014 Therp BV () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import ir_attachment diff --git a/attachment_preview/models/ir_attachment.py b/attachment_preview/models/ir_attachment.py index 0b88b0e7..ee53880e 100644 --- a/attachment_preview/models/ir_attachment.py +++ b/attachment_preview/models/ir_attachment.py @@ -46,6 +46,7 @@ class IrAttachment(models.Model): continue try: import magic + magic = magic.Magic(magic.flags.MAGIC_NONE) if model == self._name and binary_field == 'datas'\ and this.store_fname: mimetype = magic.from_file( @@ -59,7 +60,7 @@ class IrAttachment(models.Model): mimetype) except ImportError: (mimetype, encoding) = mimetypes.guess_type( - 'data:;base64,' + this[binary_field], strict=False) + 'data:;base64,' + str(this[binary_field]), strict=False) _logger.debug('Mimetypes guessed type %s from buffer', mimetype) extension = mimetypes.guess_extension( diff --git a/attachment_preview/readme/CREDITS.rst b/attachment_preview/readme/CREDITS.rst index 07bb3a4e..ad5c83e0 100644 --- a/attachment_preview/readme/CREDITS.rst +++ b/attachment_preview/readme/CREDITS.rst @@ -1,4 +1,4 @@ -Addon icon ----------- +Module icon +----------- * courtesy of http://commons.wikimedia.org/wiki/Crystal_Clear diff --git a/attachment_preview/readme/DESCRIPTION.rst b/attachment_preview/readme/DESCRIPTION.rst index aadfd944..7cf0f78e 100644 --- a/attachment_preview/readme/DESCRIPTION.rst +++ b/attachment_preview/readme/DESCRIPTION.rst @@ -1,4 +1,4 @@ -This addon allows to preview attachments supported by http://viewerjs.org. +This module allows to preview attachments supported by http://viewerjs.org. Currently, that's most Libreoffice files and PDFs. diff --git a/attachment_preview/readme/INSTALL.rst b/attachment_preview/readme/INSTALL.rst index eb26fced..6f45c2f0 100644 --- a/attachment_preview/readme/INSTALL.rst +++ b/attachment_preview/readme/INSTALL.rst @@ -1,4 +1,4 @@ For filetype recognition, you'll get the best results by installing ``python-magic``: -sudo apt-get install python-magic +sudo apt-get install python3-magic diff --git a/attachment_preview/static/description/index.html b/attachment_preview/static/description/index.html index 28ae9376..73d59c1c 100644 --- a/attachment_preview/static/description/index.html +++ b/attachment_preview/static/description/index.html @@ -4,7 +4,7 @@ -Preview attachments +Attachment Preview