Skip to Content
Menu
This question has been flagged

I ve .js files which are working perfectly in html and also when place static value on qweb. But i am now trying to send values to produce dynamic results for qweb pdf but issue is i am not getting succeed anywhere.

files: https://github.com/nathanleiby/growthchart


This produces ok bt it has static values.


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_chart">
<t t-call="web.html_container">
<t t-call="oehealth_all_in_one.health_external_layout">
<div class="page">

<link rel="stylesheet" href="/oehealth_all_in_one/static/src/css/growthchart.css"/>
<script type="text/javascript" src="/oehealth_all_in_one/static/src/js/d3.js"></script>
<script type="text/javascript" src="/oehealth_all_in_one/static/src/js/growthchart.js"></script>
<t t-foreach="docs" t-as="o">
<script>

var patientGrowth = [
[5.27, 7.4],
[6.17, 7.2],
[6.9, 7.3],
[8.03, 7.0],
[9.37, 7.2],
[12, 6.4],
[12.53, 6.4],
[13.7, 6.7],
[14.83, 6.8],
[16.67, 6.8],
[17.9, 7.7],
[19.3, 7.9],
[22.23, 7.5],
[24.2, 8.2],
[26.07, 9.6],
[28.4, 9.5],
// [30, 9.4],
// [31, 10.7],
// [32, 12.1],
// [33, 13.8],
// [60, 18.3],
];
var growthChart = display_growth_chart(patientGrowth, 'div' , 'wfa_haiti_0_to_5');

</script>
</t>


</div>
</t>
</t>
</template>


<report
id="action_chart_report"
model="oeh.medical.evaluation"
string="Chart"
report_type="qweb-pdf"
name="oehealth_all_in_one.report_chart"
file="oehealth_all_in_one.report_chart"

/>
</data>
</odoo>


But when i place in <t t-esc=""/> it does not produces anything:


<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_chart">
<t t-call="web.html_container">
<t t-call="oehealth_all_in_one.health_external_layout">
<div class="page">

<link rel="stylesheet" href="/oehealth_all_in_one/static/src/css/growthchart.css"/>
<script type="text/javascript" src="/oehealth_all_in_one/static/src/js/d3.js"></script>
<script type="text/javascript" src="/oehealth_all_in_one/static/src/js/growthchart.js"></script>
<t t-foreach="docs" t-as="o">

<t t-esc="display_growth_chart([[22.23, 7.5]], 'div' , 'wfa_haiti_0_to_5')"/>

</t>


</div>
</t>
</t>
</template>


<report
id="action_chart_report"
model="oeh.medical.evaluation"
string="Chart"
report_type="qweb-pdf"
name="oehealth_all_in_one.report_chart"
file="oehealth_all_in_one.report_chart"

/>
</data>
</odoo>
Avatar
Discard
Related Posts Replies Views Activity
1
Dec 24
129
2
Nov 24
85
1
Oct 24
265
0
Sep 24
213
2
Sep 24
648