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

Hi, I am trying to add an attachment 

pdf = self.env.ref('india_gst.report_gst_invoice_menu').render_qweb_pdf(picking.out_invoice_ids.id)[0]
vals = {
'res_model': 'account.invoice',
'res_id': picking.out_invoice_ids.id,
'datas': base64.b64encode(pdf),
'name': 'recent_bill.pdf',
'mimetype': 'application/pdf',
}
atac_id = self.env['ir.attachment'].create(vals)


But when I try to download the attachment it downloads some binary file.
الصورة الرمزية
إهمال
الكاتب أفضل إجابة

for me adding the field 'datas_fname' in vals worked

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
11
أبريل 23
28337
4
ديسمبر 22
4460
4
مارس 21
10654
1
أغسطس 18
5628
2
نوفمبر 21
7498