Hi everyone,
I created a qweb-pdf template that works pretty (PDF file is generate without error) well except for one thing : a field (customer_name) value is not displayed.
This is report template code snippet :
..
t-if="customer_name">
The custom value is: t-esc="customer_name"/>
..
I call this qweb-pdf from JS file (on POS environment) like this :
..
await this.env.pos.do_action('my_module.pos_custom_report', {
additional_context: {
active_ids: [119], // 119 is value for my test..
customer_name: this.props.customer_name, // This is the value I want to display in my customer_name field on the report
},
});
..
In _get_report_values method, when i print context, i don't see 'customer_name' i pass in my JS. So i don't know how to pass value i don't see here inside my report template.
..
@api.model
def _get_report_values(self, docids, data=None):
print("a+A _get_report_values _context :", self._context)
docs = self.env['pos.order'].browse(docids)
return {
'doc_ids': docids,
'doc_model': 'pos.order',
'docs': docs,
}
..
How can i do to pass customer_name from JS to my custom report template ?
What am I missing ?
Thanks for any help !