跳至内容
菜单
此问题已终结
1 回复
5454 查看

hi,

i create one app for snippet in odoo v9

all image will render properly but js function not load properly in odoo

i create one js function and how we load that js file snippet


形象
丢弃
最佳答案

create an xml file and add this into it :

<openerp>

<data>

<template id="assets_backend" name="my_module assets" inherit_id="web.assets_backend">

<xpath expr="." position="inside">

<script type="text/javascript" src="/my_module/path_to_file1.js"></script

<script type="text/javascript" src="/my_module/path_to_file2.js"></script>

</xpath>

</template>

</data>

</openerp>


Don't forget to add it to __openerp__.py file !

 

形象
丢弃
编写者

can you please specify that how we maintain order for js file

编写者

if we include more than one files so how we can manage order for js file

I edited my last answer for how to include multiple files

编写者

hi thanks for your valuable reply it really helpful for me but one issue is there when i load js do slider called first than the code so slider not loading properly only images are render can you please tell me how can i solve that issue

That is because your js code is executed before the images you want to select on your slider. You will need to implement a slider widget . You can find more about widgets in the official documentation.

编写者

thanks motez but i am new to odoo ,can you please provide any example for that so it really helpful for me

welcome to the community katrik :) as a start have a look at the pet sotre tutorial. you can find the default Odoo widgets in the web module. Also you can find a plenty of community web modules that you can refer to...