Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
4785 Lượt xem

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!

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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])



Ảnh đại diện
Huỷ bỏ

Thanks alot... Works perfectly

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 4 23
1741
1
thg 3 22
3441
PDF reports Đã xử lý
5
thg 7 25
2155
Wrong PDF Format Đã xử lý
2
thg 3 24
2693
0
thg 11 22
2895