Odoo Help


5 Answers

Andreas Tolstov

--Andreas Tolstov--

| 6 6 10
Hamburg, Alemanha
--Andreas Tolstov--


Andreas Tolstov
24/06/14 12:17

In v8 adding of static files is different as v7.

You must define static files in view, where you inheriting core views.

1. in module folder create folder named views

2. create in where file named: you_module_name.xml

3. in __openerp.py__ add: 'data': ['views/you_module_name.xml']

4. in you_module_name.xml add: 

<?xml version="1.0" encoding="utf-8"?>
        <template id="assets_backend" name="you_module_name assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                <link rel="stylesheet" href="/you_module_name/static/src/css/you_module_name.css"/>
                <script type="text/javascript" src="/you_module_name/static/src/js/you_module_name.js"></script>
GH Mediacloud, Grover Hernando Menacho Quisbert
24/06/14 17:37

Thanks a lot. That helped me a lot. I've created my own module to add only css and js to POS since I don't want that everywhere. And everything is working like a charm. Thanks for the guide.

Pascal Tremblay
17/02/15 16:09

If I want to override some css in the file /home/odoo/addons/point_of_sale/static/src/css/pos.css. But when I enter in my POS, my CSS are not applied when I declare it like you. How to override CSS from the file pos.css?

Gregor Heger
07/01/15 01:41

I haven't found this in the documentation... isn't there any easier way? Creating a whole xml with xpath inheritance sounds like too much work for adding a simple css class...


And what kind of view is this, the template tag is not familiar to me. Is this a QWeb Template? I didn't use QWeb Templates for my module - do I have to create some?

Henrik Norlin
08/04/15 12:09

I thought that the template would need some extra customization, but I only had to change "you_module_name" and make sure that the path for css / js was correct. Thanks for the template!

Ask a Question
Keep Informed
7 follower(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Odoo Training Center

Access to our eLearning platform and experience all Odoo Apps through learning videos, use cases and quizzes.

Test it now