Odoo Help

Welcome!

This community 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.

0

Custom CSS / JS through view inheritance - right or wrong?

By
Frank Adler
on 8/22/14, 10:52 PM 1,664 views

Hi, 

A few people have asked how to get your own CSS / JS file inserted into the website or eCommerce without having to create a module.

I found that an easy way was to go to Technical - Interface - Views and create a new view (type QWeb) which inherits the existing view "Website Assets". Then simply add the following code to it:

```
<?xml version="1.0"?>
<data name="website assets frontend checkd" inherit_id="web.assets_frontend">
      <xpath expr="." position="inside">
           <link rel="stylesheet" href="/path/to/your/file/even/ext/link"/>
           <!-- <script type="text/javascript" src="/path/to/your/js"/> -->
      </xpath>
</data>

```

Could someone comment on whether:
a) this is the 'recommended' way to do it
b) any pro's or con's to doing this? (e.g. will it survive future updates?)

Thanks
Frank

2

Fabien Pinckaers (fp)

--Fabien Pinckaers (fp)--
6598
| 6 8 8
fsdsdfsdf, Belgium
--Fabien Pinckaers (fp)--

Odoo Founder & CEO

Fabien Pinckaers (fp)
On 8/23/14, 3:06 AM

It's the way to do.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 8/22/14, 10:52 PM
Seen: 1664 times
Last updated: 3/16/15, 8:10 AM