mirror of https://github.com/OCA/web.git
[11.0][MIG] Standard Migration
parent
a2836f2e40
commit
8c651be802
|
@ -68,6 +68,7 @@ Contributors
|
||||||
* Holger Brunn <hbrunn@therp.nl>
|
* Holger Brunn <hbrunn@therp.nl>
|
||||||
* Pedro M. Baeza <pedro.baeza@gmail.com>
|
* Pedro M. Baeza <pedro.baeza@gmail.com>
|
||||||
* Dennis Sluijk <d.sluijk@onestein.nl>
|
* Dennis Sluijk <d.sluijk@onestein.nl>
|
||||||
|
* Marçal Isern <marsal.isern@qubiq.es>
|
||||||
|
|
||||||
Maintainer
|
Maintainer
|
||||||
----------
|
----------
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2015 Therp BV <http://therp.nl>
|
# Copyright 2015 Therp BV <http://therp.nl>
|
||||||
# © 2016 Pedro M. Baeza
|
# Copyright 2016 Pedro M. Baeza
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
{
|
{
|
||||||
"name": "Custom shortcut icon",
|
"name": "Custom shortcut icon",
|
||||||
"version": "10.0.1.0.0",
|
"version": "11.0.1.0.0",
|
||||||
"author": "Therp BV, "
|
"author": "Therp BV, "
|
||||||
"Tecnativa, "
|
"Tecnativa, "
|
||||||
"Odoo Community Association (OCA)",
|
"Odoo Community Association (OCA)",
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2015 Therp BV <http://therp.nl>
|
# Copyright 2015 Therp BV <http://therp.nl>
|
||||||
|
# Copyright 2017 QubiQ 2010 <http://www.qubiq.es>
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
import StringIO
|
from io import BytesIO
|
||||||
import base64
|
import base64
|
||||||
from odoo import http
|
from odoo import http
|
||||||
from odoo.tools.misc import file_open
|
from odoo.tools.misc import file_open
|
||||||
|
@ -21,9 +22,9 @@ class WebFavicon(http.Controller):
|
||||||
favicon = company.favicon_backend
|
favicon = company.favicon_backend
|
||||||
favicon_mimetype = company.favicon_backend_mimetype
|
favicon_mimetype = company.favicon_backend_mimetype
|
||||||
if not favicon:
|
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'
|
favicon_mimetype = 'image/x-icon'
|
||||||
else:
|
else:
|
||||||
favicon = StringIO.StringIO(base64.b64decode(favicon))
|
favicon = BytesIO(base64.b64decode(favicon))
|
||||||
return request.make_response(
|
return request.make_response(
|
||||||
favicon.read(), [('Content-Type', favicon_mimetype)])
|
favicon.read(), [('Content-Type', favicon_mimetype)])
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
# © 2015 Therp BV <http://therp.nl>
|
# Copyright 2015 Therp BV <http://therp.nl>
|
||||||
# © 2016 Pedro M. Baeza
|
# Copyright 2016 Pedro M. Baeza
|
||||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||||
|
|
||||||
from odoo import models, fields
|
from odoo import models, fields
|
||||||
|
|
|
@ -39,7 +39,7 @@ class TestWebFavicon(TransactionCase):
|
||||||
# our own icon
|
# our own icon
|
||||||
company.write({
|
company.write({
|
||||||
'favicon_backend': base64.b64encode(file_open(
|
'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',
|
'favicon_backend_mimetype': 'image/png',
|
||||||
})
|
})
|
||||||
data = WebFavicon().icon()
|
data = WebFavicon().icon()
|
||||||
|
|
Loading…
Reference in New Issue