rma_bjr
rma_bjr

Reputation: 45

Add css file odoo 11

I'd like to add css file to my report on odoo v11. so I us this code:

 <template id="assets_backend" inherit_id="web.assets_backend">
    <xpath expr="." position="inside">
        <link href="/my_module/static/src/css/file.css" rel="stylesheet"/>
    </xpath>
</template>

When I update the module I get this error:

The style compilation failed, see the error below. Your recent actions may be the cause, please try reverting the changes you made.

Could not get content for /my_module/static/src/css/file.css defined in bundle 'web.assets_backend'.

Can you help me?

Upvotes: 1

Views: 3098

Answers (2)

edibertkk
edibertkk

Reputation: 11

  1. Check if requirements.txt or dependencies installed well.

  2. sudo apt install python3-libsass

OR

sudo pip3 install libsass==0.12.3

Upvotes: 1

Veikko
Veikko

Reputation: 3610

You will get this error if you do not have the "file.css" available when Odoo builds the web assets. Please check that it is in the right path and correct permissions are in place.

You can find a good tutorial on web assets from https://www.odoo.yenthevg.com/adding-static-resources-css-and-javascript-to-odoo/. Reference material is available in Odoo developer documentation site at https://www.odoo.com/documentation/11.0/index.html.

If you are not able to get this working after reading and following the material found from the links, please provide exact information about your module setup.

Upvotes: 0

Related Questions