Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
2737 Tampilan

With Q2 over, i want to export all posted vendor bills for Q2.


When i select them and choose 'print / original bills' 


i get these exceptions:


File "/home/odoo/src/odoo/addons/account/models/ir_actions_report.py", line 57, in _retrieve_stream_from_attachment
return pdf.add_banner(stream, record.name, logo=True)
File "/home/odoo/src/odoo/odoo/tools/pdf.py", line 103, in add_banner
for p in range(old_pdf.getNumPages()):
File "/usr/lib/python3/dist-packages/PyPDF2/pdf.py", line 1150, in getNumPages
raise utils.PdfReadError("File has not been decrypted")
PyPDF2.utils.PdfReadError: File has not been decrypted


I guess one of the bills is in a pdf format not supported by PyPDF2, it cannot be decrypted and hence it cannot add the odoo banner to it.


Any workaround to be able to export my bills ?

Avatar
Buang
Jawaban Terbai

This error may occure due to old or different version of PyPDF2. please make sure you have following version

PyPDF2==1.26.0

you can install correct package using following command.

pip3 install PyPDF2==1.26.0


Thanks & Regards,



CandidRoot Solutions Pvt. Ltd.

Mobile: (+91) 8849036209
Email: info@candidroot.com
Skype: live:candidroot
Web: https://www.candidroot.com
Address: 1229-1230, Iconic Shyamal, Near Shyamal Cross Road, Ahmedabad, Gujarat 380015
    

Avatar
Buang
Penulis

Running on odoo.sh so i hope they have their versions sorted.
After further investigation it looks to be an encrypted pdf for which odoo tries to alter and does not have any error handling in place.

Post Terkait Replies Tampilan Aktivitas
1
Jun 23
2959
1
Jan 23
2130
0
Apr 24
2175
0
Feb 24
1350
0
Feb 24
1839