1. Creating XML
The first step is to create a new XML file in your custom module under your ModuleName/views, as cited below:
Nextly add this new XML file to __manifest__ file
Open up __manifest__.py and add in a line in the data block.
Make sure you give the right path and filename
Now return to your XML file.
2.1 CREATING YOUR CSS FILES
Create a new folder ‘css’. This is the official structure for adding CSS files to Odoo! Now create a new CSS file in this folder. I’ve named it message.css’ just for demo purposes, but you can rename this whatever you like. The final result will now look like this:
As Odoo is unknown to the path of CSS file, open your XML file again and add the path to the CSS file:
It is very important to add the name of your module in the path and then continue with /static/src/css/yourFileName.css.
Create a new folder ‘js’ and then create a new JS file in it.
As Odoo is not known to the CSS file path, once again open your XML file and add the path to the CSS file:
For more reference, you can refer our custom modules published in Odoo Apps. One of the module link is attached below.