I am trying to include my custom javascript in my module but the js file is not getting loaded.
Below is my code:
js:
openerp.hr_timesheet_extended = function (instance) {
var QWeb = instance.web.qweb,
_t = instance.web._t,
_lt = instance.web._lt;
instance.hr_attendance.AttendanceSlider.include({
// override methods
});
};
xml:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="assets_backend" name="hr_attendance assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/my_module/static/src/js/attendance.js"></script>
</xpath>
</template>
</data>
</openerp>
What am I doing wrong here?
__openerp__.py? Try writing the name of your module as the xml file name (your_module_name.xml) and replace the name of the template toname="your_module_name assets". Do you get any error in the console of your browser? Write and example of a overriden method and try writing some console.log() to check if the file is executed