Feng’ Blog

OdooERP引入CSS及JavaScript
在module/view下创建一个新的xml例子<?xml version="1.0" ...
扫描右侧二维码阅读全文
21
2019/01

OdooERP引入CSS及JavaScript

在module/view下创建一个新的xml

例子

<?xml version="1.0" encoding="utf-8"?>
<odoo>
    <template id="assets_backend" name="web_kanban assets" inherit_id="web.assets_backend">
        <xpath expr="//script[last()]" position="inside">
            <link rel="stylesheet" href="/web_kanban/static/src/less/kanban_dashboard.less"/>
            <link rel="stylesheet" href="/web_kanban/static/src/less/kanban_view.less"/>
            <script type="text/javascript" src="/web_kanban/static/src/js/record.js"></script>
            <script type="text/javascript" src="/web_kanban/static/src/js/relational.js"></script>
            <script type="text/javascript" src="/web_kanban/static/src/js/column.js"></script>
            <script type="text/javascript" src="/web_kanban/static/src/js/widgets.js"></script>
        </xpath>
    </template>
</odoo>

方法一

引入XML至manifest.py文件

{
   'data':['views/resources.xml']
}

方法二

直接在manifest.py引入

'css': ['static/src/css/sale.css']
Last modification:January 21st, 2019 at 05:57 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment