|
<!-- Note: the ID's of your Company records may not be 1 and 2, so adjust accordingly --> |
|
|
|
<!-- Odoo 17 --> |
|
<data inherit_id="web.layout"> |
|
<xpath expr="//body" position="inside"> |
|
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '1'"> |
|
<style>.o_main_navbar {background: linear-gradient(45deg, #57596F, #57596F); |
|
background-color: #57596F!important;border-bottom: 0px;}</style></t> |
|
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '2'"> |
|
<style>.o_main_navbar {background: linear-gradient(45deg, #6B3C3C, #6B3C3C); |
|
background-color: #6B3C3C!important;border-bottom: 0px;}</style></t> |
|
</xpath> |
|
</data> |
|
|
|
<!-- Odoo 18 --> |
|
<data inherit_id="web.layout"> |
|
<xpath expr="//body" position="inside"> |
|
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '1'"> |
|
<style>.o_main_navbar {background: linear-gradient(45deg, #ffcccc, #ffcccc); |
|
background-color: #ffcccc!important; |
|
border-bottom: 0px; |
|
} |
|
.dropdown-toggle {background: linear-gradient(45deg, #ffcccc, #ffcccc); |
|
background-color: #ffcccc!important; |
|
border-bottom: 0px; |
|
} |
|
.o_nav_entry {background: linear-gradient(45deg, #ffcccc, #ffcccc); |
|
background-color: #ffcccc!important; |
|
border-bottom: 0px; |
|
}</style></t> |
|
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '2'"> |
|
<style>.o_main_navbar {background: linear-gradient(45deg, #ccccff, #ccccff); |
|
background-color: #ccccff!important;border-bottom: 0px;} |
|
.dropdown-toggle {background: linear-gradient(45deg, #ccccff, #ccccff); |
|
background-color: #ccccff!important;border-bottom: 0px;} |
|
.o_nav_entry {background: linear-gradient(45deg, #ccccff, #ccccff); |
|
background-color: #ccccff!important;border-bottom: 0px;} |
|
</style> |
|
</t> |
|
<t t-if="request.httprequest.cookies.get('cids') and request.httprequest.cookies.get('cids')[0] == '3'"> |
|
<style>.o_main_navbar {background: linear-gradient(45deg, #ccffcc, #ccffcc); |
|
background-color: #ccffcc!important;border-bottom: 0px;} |
|
.dropdown-toggle {background: linear-gradient(45deg, #ccffcc, #ccffcc); |
|
background-color: #ccffcc!important;border-bottom: 0px;} |
|
.o_nav_entry {background: linear-gradient(45deg, #ccffcc, #ccffcc); |
|
background-color: #ccffcc!important;border-bottom: 0px;}</style></t> |
|
</xpath> |
|
</data> |
|
|
|
<!-- Odoo 19.0 --> |
|
<data inherit_id="web.layout"> |
|
|
|
<xpath expr="//body" position="inside"> |
|
|
|
<t t-set="cookie_cids" t-value="request.httprequest.cookies.get('cids')"/> |
|
<t t-set="current_company_id" t-value="int(cookie_cids.split(',')[0]) if cookie_cids else request.env.user.company_id.id"/> |
|
<t t-set="target_company" t-value="request.env['res.company'].sudo().browse(current_company_id)"/> |
|
|
|
<t t-set="color_map" t-value="{ 0: '#8E44AD', 1: '#E74C3C', 2: '#F39C12', 3: '#F1C40F', 4: '#3498DB', 5: '#D35400', 6: '#C0392B', 7: '#1ABC9C', 8: '#34495E', 9: '#E91E63', 10: '#2ECC71', 11: '#9B59B6' }"/> |
|
|
|
<t t-set="color_int" t-value="target_company.color or 0"/> |
|
<t t-set="bar_color" t-value="color_map.get(color_int, '#8E44AD')"/> |
|
|
|
<div><center><h3 t-attf-style="background-color: {{ bar_color }};position: relative;display: block;"><t t-esc="target_company.name"/></h3></center></div> |
|
|
|
</xpath> |
|
|
|
</data> |
While doing a v18 upgrade this is what I am settling with for v18
Edit: Cant get screenshot to upload :(