Skip to Content
Menu
This question has been flagged
2 Replies
12182 Views

hello,i want to call or execute javascript code inside the qweb template.i am trying t-js but its not working

Avatar
Discard
Author Best Answer

in projects_report.xml file:

<template id="minimal_layout1">

<t t-raw="'&lt;base href=%s&gt;' % base_url"/>

&lt;!DOCTYPE html&gt;

<html style="height: 0;">

<head>

<script type="text/javascript">

function subst() {

alert("odoo");

document.write(5+6);

}

</script>

</head>

<body class="container" onload="subst()">

<t t-raw="body"/>

</body>

</html>

</template>

<t t-call="projects_report.minimal_layout1"/>

or

<template id="summernote1" name="Summernote">

<script type="text/javascript">

(function () {

alert("adsa global");

document.write("adsa");

})();

</script>

</template>

<t t-call="projects_report.summernote1"/>

am trying these types to call javascript inside the qweb but the function is not loading ,its not throwing any errors.i am very new to qweb can you plz solve this .


Avatar
Discard
Best Answer

To help you better can you provide your code and the error / log ? 

Kind regards 

Avatar
Discard