Skip to Content
Menu
This question has been flagged
1 Reply
2669 Views

Hi,

I want to change navbar color permanently via code,
Odoo version 12 EE.
Thanks.

Avatar
Discard
Best Answer

Hi,

If you need to do it without installing a module, better option is to do from user interface by creating a new view from the settings. Please see this post in the forum which shows how to change navbar color: https://www.odoo.com/forum/help-1/can-i-have-a-different-theme-color-navbar-for-each-company-v15-ee-203360


By rewriting the above logic, you can change the navbar color permanently using a inherited view.

Thanks

Avatar
Discard
Author

Hi thanks for reply,
I checked the source code and found the necessary files,so this is what i did:
<p>&lt;template id=&quot;assets_backend&quot; name=&quot;custom_style&quot; inherit_id=&quot;web.assets_backend&quot;&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &lt;xpath expr=&quot;.&quot; position=&quot;inside&quot;&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;link rel=&quot;stylesheet type=&quot;text/css&quot; href=&quot;css file path&quot;&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp;&lt;/xpath&gt;</p>
<p>&lt;t/emplate&gt;</p>
my css file :
.o_main_navbar {
position : relative;
height : 46px;
border-bottom : 1px #navbar_underline_color;
background-color : #navbar_color_desired;
color : #the_font_color;
}

Author

<template id="assets_backend" name="custom_style" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/HTC_decharge/static/src/css/custom_style_.css"/>
</xpath>
</template>

Related Posts Replies Views Activity
5
Aug 24
304
0
Jan 22
1128
1
Sep 21
2648
1
Sep 21
4098
6
Jan 19
7776