This question has been flagged
1 Reply
4669 Views

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


Avatar
Discard
Best Answer

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 !

 

Avatar
Discard
Author

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

Author

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

Author

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.

Author

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...