mirror of https://github.com/OCA/web.git
[IMP] review points
parent
560b6c9472
commit
6a21060cc5
|
@ -25,9 +25,7 @@ Usage
|
||||||
|
|
||||||
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
|
||||||
:alt: Try me on Runbot
|
:alt: Try me on Runbot
|
||||||
:target: https://runbot.odoo-community.org/runbot/{repo_id}/8.0
|
:target: https://runbot.odoo-community.org/runbot/162/8.0
|
||||||
|
|
||||||
.. repo_id is available in https://github.com/OCA/maintainer-tools/blob/master/tools/repos_with_ids.txt
|
|
||||||
|
|
||||||
For further information, please visit:
|
For further information, please visit:
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,11 @@ class WebFavicon(http.Controller):
|
||||||
@http.route('/web_favicon/favicon', type='http', auth="none")
|
@http.route('/web_favicon/favicon', type='http', auth="none")
|
||||||
def icon(self):
|
def icon(self):
|
||||||
request = http.request
|
request = http.request
|
||||||
company = request.env['res.company'].search([], limit=1)
|
|
||||||
if 'uid' in request.env.context:
|
if 'uid' in request.env.context:
|
||||||
user = request.env['res.users'].browse(request.env.context['uid'])
|
user = request.env['res.users'].browse(request.env.context['uid'])
|
||||||
company = user.sudo(user.id).company_id
|
company = user.sudo(user.id).company_id
|
||||||
|
else:
|
||||||
|
company = request.env['res.company'].search([], limit=1)
|
||||||
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:
|
||||||
|
|
|
@ -37,8 +37,6 @@ class FakeResponse(object):
|
||||||
self.headers = dict(headers)
|
self.headers = dict(headers)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class TestWebFavicon(TransactionCase):
|
class TestWebFavicon(TransactionCase):
|
||||||
def test_web_favicon(self):
|
def test_web_favicon(self):
|
||||||
original_request = http.request
|
original_request = http.request
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<data>
|
<data>
|
||||||
<template id="layout" inherit_id="web.layout">
|
<template id="layout" inherit_id="web.layout">
|
||||||
<xpath expr="//link[@rel='shortcut icon']" position="replace">
|
<xpath expr="//link[@rel='shortcut icon']" position="replace">
|
||||||
<link rel="shortcut icon" href="/web_favicon/favicon" />
|
<link rel="icon" href="/web_favicon/favicon" />
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
</data>
|
</data>
|
||||||
|
|
Loading…
Reference in New Issue