Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2584 Lượt xem

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 ?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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
    

Ảnh đại diện
Huỷ bỏ
Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 6 23
2814
1
thg 1 23
2020
0
thg 4 24
1926
0
thg 2 24
1171
0
thg 2 24
1658