diff --git a/web_favicon/README.rst b/web_favicon/README.rst index d3d67e98..ae78ca98 100644 --- a/web_favicon/README.rst +++ b/web_favicon/README.rst @@ -68,6 +68,7 @@ Contributors * Holger Brunn * Pedro M. Baeza * Dennis Sluijk +* Marçal Isern Maintainer ---------- diff --git a/web_favicon/__manifest__.py b/web_favicon/__manifest__.py index d70733a7..dfa8f463 100644 --- a/web_favicon/__manifest__.py +++ b/web_favicon/__manifest__.py @@ -1,11 +1,11 @@ # -*- coding: utf-8 -*- -# © 2015 Therp BV -# © 2016 Pedro M. Baeza +# Copyright 2015 Therp BV +# Copyright 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Custom shortcut icon", - "version": "10.0.1.0.0", + "version": "11.0.1.0.0", "author": "Therp BV, " "Tecnativa, " "Odoo Community Association (OCA)", diff --git a/web_favicon/controllers/web_favicon.py b/web_favicon/controllers/web_favicon.py index 7585ce15..a72b31c0 100644 --- a/web_favicon/controllers/web_favicon.py +++ b/web_favicon/controllers/web_favicon.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -# © 2015 Therp BV +# Copyright 2015 Therp BV +# Copyright 2017 QubiQ 2010 # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -import StringIO +from io import BytesIO import base64 from odoo import http from odoo.tools.misc import file_open @@ -21,9 +22,9 @@ class WebFavicon(http.Controller): favicon = company.favicon_backend favicon_mimetype = company.favicon_backend_mimetype if not favicon: - favicon = file_open('web/static/src/img/favicon.ico') + favicon = file_open('web/static/src/img/favicon.ico', 'rb') favicon_mimetype = 'image/x-icon' else: - favicon = StringIO.StringIO(base64.b64decode(favicon)) + favicon = BytesIO(base64.b64decode(favicon)) return request.make_response( favicon.read(), [('Content-Type', favicon_mimetype)]) diff --git a/web_favicon/models/res_company.py b/web_favicon/models/res_company.py index 9fdd8ace..36a7b032 100644 --- a/web_favicon/models/res_company.py +++ b/web_favicon/models/res_company.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -# © 2015 Therp BV -# © 2016 Pedro M. Baeza +# Copyright 2015 Therp BV +# Copyright 2016 Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields diff --git a/web_favicon/tests/test_web_favicon.py b/web_favicon/tests/test_web_favicon.py index 90414956..78222d31 100644 --- a/web_favicon/tests/test_web_favicon.py +++ b/web_favicon/tests/test_web_favicon.py @@ -39,7 +39,7 @@ class TestWebFavicon(TransactionCase): # our own icon company.write({ 'favicon_backend': base64.b64encode(file_open( - 'web_favicon/static/description/icon.png').read()), + 'web_favicon/static/description/icon.png', 'rb').read()), 'favicon_backend_mimetype': 'image/png', }) data = WebFavicon().icon()