[FIX] website: provide favicon for pdf tabs

When opening the pdf at the end of an order Chrome tries to load
/favicon.ico which returns 404 before this patch. We provide the
favicon from the current website.

closes odoo/odoo#33746

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
This commit is contained in:
Andreas Perhab
2019-05-29 10:02:18 +00:00
committed by Jeremy Kersten
parent 3e12f2ff56
commit 8242ddbc10
+5
View File
@@ -443,3 +443,8 @@ class WebsiteBinary(http.Controller):
if unique:
kw['unique'] = unique
return Binary().content_image(**kw)
@http.route(['/favicon.ico'], type='http', auth='public', website=True)
def favicon(self, **kw):
# when opening a pdf in chrome, chrome tries to open the default favicon url
return self.content_image(model='website', id=str(request.website.id), field='favicon', **kw)