تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
9023 أدوات العرض

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
أبريل 20
9126
1
نوفمبر 19
4030
3
أكتوبر 19
7862
2
فبراير 18
14069
0
يناير 18
8750