I'd like to generate a PDF containing all stock.report_picking reports for all deliveries for a given sale order, merged into one file. I've already done something similar for shipping labels where each label was saved as an ir.attachment record.
But in this case, the stock.report_picking report doesn't appear to be saved anywhere as far as I can tell. It appears to be regenerated on the fly whenever the user opens the "Print" menu and clicks on the report action (or if I go to /report/pdf/stock.report_picking/<id>).
So how would I generate the report in Python such that I can get the binary PDF data for the report (similar to the datas field on an attachment record) so I can then pass a list of report datas to the odoo.tools.pdf.merge_pdf function? I can then get my final result and do whatever I want with it (send it back via an HTTP response, save it in an attachment record, or whatever).
I know I could just make an HTTP request to /report/pdf/stock.report_picking/<id> for each record I want a report for, and then grab the binary data from the response. But that just seems like the wrong way to achieve something I should be able to do right inside of Python. I can't find anything in the official documentation concerning how to achieve this.
So then, back to the title: How do I generate an Odoo PDF report from Python?