How to add css files to a custom module in Odoo?

前端 未结 1 843
既然无缘
既然无缘 2020-12-09 14:22

How can I add css files to my custom module to change xml views? I found this post but the solution is not working.

I want modify all the elements from my module, su

1条回答
  •  心在旅途
    2020-12-09 14:48

    1. You must create the css file in this route: /module_name/static/src/css/module_name.css. Example of file:
    .openerp .classname{
        margin: 12px 0px 12px 0px;
    }
    
    1. Create the file /module_name/views/module_name.xml with this content:
    
    
        
            
             
    
    
    1. Add the xml file to your __openerp.__py
    'data': [
        'views/module_name.xml',
    ],
    
    1. Add the class to the elements in the view

    0 讨论(0)
提交回复
热议问题