İçereği Atla
Menü
Bu soru işaretlendi
11 Cevaplar
65341 Görünümler

How to change Favicon?

Avatar
Vazgeç
En İyi Yanıt

Install app Favicon shortcut and edit image in menu Configuration > Company > Web Favicon

Avatar
Vazgeç
En İyi Yanıt

You have to override the web module with your own module. You can add a line like

'data': [ 'views/website_templates.xml' ]

in your __openerp__.py.

Put your favicon at static/src/img/favicon.ico and add a template to views/website_templates:

<template id="MYSITE_layout" inherit_id="website.layout" name="MYSITE layout" priority="17">
<xpath expr="//head//link" position="after">
<link rel="shortcut icon" href="/MYSITE_web/static/src/img/favicon.ico" type="image/x-icon"/>
</xpath>
</template>

Avatar
Vazgeç
En İyi Yanıt

You can try my module web_debranding

It allows to configure favicon dynamically at Settings\System Parameters:

    <template id="web_debranding.web_layout" inherit_id="web.layout">
<xpath expr="//title" position="replace"></xpath>
<xpath expr="//link[@rel='shortcut icon']" position="replace">
<t t-set="favicon" t-value="request.env['ir.config_parameter'].get_param('web_debranding.favicon_url', '').strip()"/>
<t t-if="favicon">
<link rel="shortcut icon" t-att-href="favicon" type="image/x-icon"/>
</t>
</xpath>
</template>


Avatar
Vazgeç
En İyi Yanıt

You may do it through the interface with the help of this module: https://apps.odoo.com/apps/modules/8.0/colors_customization/

Avatar
Vazgeç
En İyi Yanıt

In V8 you can change favicon by modifying templates. See e.g. "website.layout" view

Avatar
Vazgeç

Could you explain your solution with one more sentence please? I found website.layout, but no reference to the used favicon. just put the reference there?

En İyi Yanıt

Hi, 

Please check this

https://youtu.be/mX8WSUnBOIU

Hope it helps,

Thanks

Avatar
Vazgeç
En İyi Yanıt

It's not a standard feature of Odoo 17, but you can acquire the app from the Odoo App Store.

Visit this link for more information: https://apps.odoo.com/apps/modules/17.0/mh_multi_company_favicon 


Avatar
Vazgeç
En İyi Yanıt

In Odoo 17 we cannot anymore change the favicon via company, they have removed the field

Avatar
Vazgeç

It's not a standard feature of Odoo 17, but you can acquire the app from the Odoo App Store.

Visit this link for more information: https://apps.odoo.com/apps/modules/17.0/mh_multi_company_favicon

En İyi Yanıt

you can also replace the favicon.ico by just tracing it and replacing the ico file with your ico file.

i tried this step and it worked.

Avatar
Vazgeç
En İyi Yanıt

Try changing the source code:

/addons/web/controllers/main.py#L548

image description

Avatar
Vazgeç

I don't like to change any default modules. Is it possible to override main.py somehow?

Try this: https://www.odoo.com/fr_FR/forum/help-1/question/how-to-remove-manage-databases-2615

En İyi Yanıt

Or just drop yours here : addons/web/static/src/img

Regards

Avatar
Vazgeç
Üretici

Thanks for you repky, but i don't want to change default module, i changed successfully using inherit JavaScript $('link[href="/web/static/src/img/favicon.ico"]').attr('href','/kderp_web/static/src/img/favicon.ico');     (function() {         var link = document.createElement('link');         link.type = 'image/x-icon';         link.rel = 'shortcut icon';         link.href = '/kderp_web/static/src/img/favicon.ico';         document.getElementsByTagName('head')[0].appendChild(link);     }());

Is it possible to somehow override stuff that's living in addons/web/static/src/img through a custom module?

İlgili Gönderiler Cevaplar Görünümler Aktivite
2
Nis 25
4919
3
Nis 25
9263
2
Nis 25
5419
2
Nis 25
7187
2
Ağu 23
6695