|
<!-- 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.0 and 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-if="cookie_cids"> |
|
<t t-set="active_cid" t-value="int(str(cookie_cids).replace('-', ',').split(',')[0])"/> |
|
</t> |
|
<t t-else=""> |
|
<t t-set="active_cid" t-value="request.env.user.company_id.id"/> |
|
</t> |
|
<t t-set="target_company" t-value="request.env['res.company'].sudo().browse(active_cid)"/> |
|
<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 t-if="target_company"> |
|
<center> |
|
<p t-attf-style="background-color: {{ bar_color }}; position: relative; display: block; color: white; font-weight: bold;"> |
|
<t t-esc="target_company.name"/> |
|
</p> |
|
</center> |
|
</div> |
|
|
|
</xpath> |
|
|
|
</data> |
While doing a v18 upgrade this is what I am settling with for v18
Edit: Cant get screenshot to upload :(