edi icon indicating copy to clipboard operation
edi copied to clipboard

PyPDF2 usage problem in pdf_helper 16.0

Open risto42 opened this issue 1 year ago • 2 comments

Module

pdf_helper in 16.0

Describe the bug

Attempting to activate some edi modules from OCA where an error traceback indicates that pdf_helper is trying to import PdfReadError from PyPDF2.utils

It does appear that PdfReadError is in PyPDF3.utils, but in PyPDF2 (which is currently used), it is found in .errors.

Additional context Here's a patch that worked for me:

diff --git a/pdf_helper/models/helper.py b/pdf_helper/models/helper.py
index 52b30355..8dbe8545 100644
--- a/pdf_helper/models/helper.py
+++ b/pdf_helper/models/helper.py
@@ -3,7 +3,7 @@
 # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).
 import logging
 
-from PyPDF2.utils import PdfReadError
+from PyPDF2.errors import PdfReadError
 
 from odoo import models

risto42 avatar Oct 28 '23 07:10 risto42

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.

github-actions[bot] avatar Apr 28 '24 12:04 github-actions[bot]

This seems to have been fixed by

commit 0329fc52cb36ff963e705ce1db00e1ef6ea6872c
Author: Jacques-Etienne Baudoux <[email protected]>
Date:   Fri Dec 22 15:57:52 2023 +0100

    [FIX] pdf_helper: multi-attachments
    
    Replace code by odoo.tools.pdf

risto42 avatar Apr 28 '24 12:04 risto42