Skip to Content
Menu
This question has been flagged
1 Reply
2586 Views

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
Discard
Best Answer

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
Discard
Author

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.

Related Posts Replies Views Activity
1
Jun 23
2814
1
Jan 23
2022
0
Apr 24
1928
0
Feb 24
1173
0
Feb 24
1663