From 8242ddbc10ebf85035ebbfe49e9b488e1f5ffc9e Mon Sep 17 00:00:00 2001 From: Andreas Perhab Date: Wed, 17 Apr 2019 07:47:40 +0000 Subject: [PATCH] [FIX] website: provide favicon for pdf tabs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- addons/website/controllers/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/website/controllers/main.py b/addons/website/controllers/main.py index ead68c28274..872cbd6dee2 100644 --- a/addons/website/controllers/main.py +++ b/addons/website/controllers/main.py @@ -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)