コンテンツへスキップ
メニュー
この質問にフラグが付けられました
1 返信
9028 ビュー

hi. i am new to odoo environment. I have watched some tutorial about adding JavaScript file to a module. But i want to add custom jquery plug-ins to my custom module. how can i do it?


here is the jquery file i want to add to my module.

http://almende.github.io/chap-links-library/js/timeline/examples/

アバター
破棄
最善の回答

Hi

In a new module put your file somewhere under static (i.e, newmodule/static/src/js or newmodule/static/lib) and put your javascript code there

Then you need a view to load your javascript code like that

<openerp>
  <data>
    <!-- Templates -->
    <template id="assets_frontend" name="newmodule_asset_frontend" inherit_id="website.theme">
      <xpath expr="." position="inside">
        <!-- Custom JS and CSS --> 
        <script type="text/javascript" src="/newmodule/static/src/js/jquerryaddons.js" /> </xpath> </template> </data> </openerp>
After that you gonna be able to use it by adding code to your page
アバター
破棄
関連投稿 返信 ビュー 活動
4
4月 20
9128
1
11月 19
4032
3
10月 19
7865
2
2月 18
14071
0
1月 18
8752