Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2720 Widoki

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 ?

Awatar
Odrzuć
Najlepsza odpowiedź

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
    

Awatar
Odrzuć
Autor

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.

Powiązane posty Odpowiedzi Widoki Czynność
1
cze 23
2942
1
sty 23
2126
0
kwi 24
2154
0
lut 24
1339
0
lut 24
1835