Hello please I would like to know how to add customized css to my menu with odoo I tried with the code injection in the head but it does not work and with a module that I installed it canceled the basic css of the site
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Buchhaltung
- Lager
- PoS
- Project
- MRP
Diese Frage wurde gekennzeichnet
Hii,
Create a custom module:
Write Your CSS ( custom_menu.css ):
Example: Styling the website's top menu bar
.o_main_navbar { background-color : #222 !important ; border-bottom : 2px solid #00aaff ; } .o_main_navbar .nav-link { color : white !important ; font-weight : bold; }
Set css as per your requirements
Define the CSS in QWeb Assets ( assets.xml )
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<template id="assets_frontend" name="Custom Menu CSS" inherit_id="web.assets_frontend">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/your_module/static/src/css/custom_menu.css"/>
</xpath>
</template>
</odoo>
Use web.assets_backend instead of web.assets_frontend if you want to style menus in the backend.
Update Manifest File ( __manifest__.py )
{
'name': 'Custom Menu Styling',
'version': '1.0',
'depends': ['web', 'website'], # or just 'web' if it's backend
'assets': {
'web. assets_frontend': [
'your_module/static/src/css/custom_menu.css',
],
},
'data': [
'views/assets.xml',
],
'installable': True,
'application': False,
}
so create that custom module
I hope it is usefull
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!
Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!
Registrieren