跳至內容
選單
此問題已被標幟
2 回覆
16442 瀏覽次數

how to include and use css in a module using odoo 9.0

頭像
捨棄
最佳答案

To use css in odoo create a folder static->src->css-> then create file_name.css.

and in the xml,

<?xml version="1.0" encoding="utf-8"?>
<openerp>
 <data>
     <template id="assets_backend" name="project assets" inherit_id="web.assets_backend">
            <xpath expr="." position="inside">
                 <link rel="stylesheet" href="/field_highlight/static/src/css/field_name.css"/>
</xpath>
 </template>
 </data>
</openerp>
頭像
捨棄

can you pls update it for Odoo 16, sir?

What about Odoo 16?

最佳答案



If your css file is for website, inherit   web.assets_frontend. or inherit web.assets_backend

<template id="assets_frontend" inherit_id="web.assets_frontend">
<xpath expr="." position="inside">
 <link rel="stylesheet" href="/your_module/static/src/css/sheet.css"/>
 </xpath>
</template>


You can watch on Youtube.

     https://www.youtube.com/ how to add css file to odoo 10

All the best ! 



頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
5
11月 24
45818
1
4月 20
9421
1
7月 24
1159
1
7月 24
1234
0
9月 23
1214