تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
4800 أدوات العرض

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
أبريل 23
1756
1
مارس 22
3448
PDF reports تم الحل
5
يوليو 25
2163
Wrong PDF Format تم الحل
2
مارس 24
2701
0
نوفمبر 22
2907