Adding CSS and JavaScript for a website
Managing assets such as CSS, JavaScript, and other static files can be done through the module’s asset management system. You can control the loading of these assets in your module by defining them in your manifest file and linking them to views or templates.
Here’s an overview of how to manage CSS and JavaScript in Odoo.
Defining assets in module manifest (__manifest__.py)
In the manifest file, specify the assets your module requires:
'assets': { Â Â Â Â Â Â Â 'web.assets_frontend': [ Â Â Â Â Â Â Â Â Â Â Â 'my_hostel/static/src/scss/hostel.scss', Â Â Â Â Â Â Â Â Â Â Â 'my_hostel/static/src/js/hostel.js', Â Â Â Â Â Â Â ], Â Â Â },
We will add CSS, SCSS, and JavaScript files, which will modify the website. As we are modifying...