Hi,
If you are using the content by passing a js file try to use rpc or Ajax
call and try to update the current value (add all values with classes)
in a variable
I'd just added an example for a chart view, you can use your own div and table classes of the bar/ any graphical representation
Js:
$.ajax({
url: '/get/parent/child',
type: 'POST',
data: JSON.stringify(result[0]),
success: function (value) {
$('#o_parent_employee').append(value);
self.parent = value
},
});
if we added all classes values in a variable and you can use the value through the controller
Controller:
@http.route('/org_chart', type='http', auth='user', method=['POST'],
csrf=False)
def organizational_chart(self, **post):
parent = post.get('parent')
data = {'parent': parent}
context = {'active_model': 'organizational.report',
'landscape': 'True'},
pdf, _ = request.env.ref(
'module_name.action_report_organizational_chart').with_context(
landscape=True)._render_qweb_pdf(data=data)
pdfhttpheaders = [('Content-Type', 'application/pdf'),
('Content-Length', len(pdf))]
return request.make_response(pdf, headers=pdfhttpheaders)
XML:
<record id="action_report_organizational_chart" model="ir.actions.report">
<field name="name">Organizational chart</field>
<field name="model">organizational.report</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">module_name.organizational_chart_report</field>
<field name="paperformat_id" ref="paper_format_org_chart"/>// you can add the paper format here
</record>
<template id="organizational_chart_report">
<t t-call="web.html_container">
<t t-call="web.internal_layout">
<h2><center>
<span>Organizational Chart</span>
</center></h2><br/>
<br/>
<center>
<t t-raw="parent"/>
</center>
</t>
</t>
</template>
if you do not need a controller or js files, you can directly pass the div chat main class through the variable
Hope it helps
Hello, did you find any solution?