I am trying to automatically print a report when a field is triggered with an automated action. In the documentation is says to return an action assign: action = {...} but nothing is happening. Here is my code. I'm just trying to download the basic package report pdf so I can then print the pdf.
action = {
'type': 'ir.actions.report',
'name': 'Package Barcode (PDF)',
'model': 'stock.quant.package',
'report_type': 'qweb-pdf',
'report_name': 'stock.action_report_quant_package_barcode_small',
}
I have also tried to use the report_action() method to download and then print the pdf report but I have had no luck with that either.
env.ref('stock.action_report_quant_package_barcode_small').report_action(record)
Any help would be appreciated. I don't want to rely on a third party module. I'm just looking for the same functionality if you where to click on the print button and then select the report you wanted to print from the UI. It downloads the pdf then you can open it and print it from there.