Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
4845 มุมมอง

I need to be able to programmatically (using python), run one of the invoice reports and save it as an attachment of some other record.

All previous versions' examples don't seem to be working now.


Anyone has a working example for this?

(a way to save the report into a pdf would suffise)

Thanks!

อวตาร
ละทิ้ง
ผู้เขียน คำตอบที่ดีที่สุด

Another Odoo version, another little change in code.


# run the report and get its content

data, data_format = self.env.ref('account.account_invoices_without_payment')\                                     .sudo()._render_qweb_pdf([origin.id])



อวตาร
ละทิ้ง

Thanks alot... Works perfectly

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
เม.ย. 23
1779
1
มี.ค. 22
3501
PDF reports แก้ไขแล้ว
5
ก.ค. 25
2226
Wrong PDF Format แก้ไขแล้ว
2
มี.ค. 24
2737
0
พ.ย. 22
2969