Files
odoo_source/odoo
Raf Geens 0a62fce86e [FIX] base: Report which PDFs can't be read
PyPDF2 can't read some PDFs due to bugs, lack of fault-tolerance and not
supporting some encryption schemes. When invoices are uploaded directly
through the Invoices / Accounting app, that will fail for those files
because it will try to read part of them. When invoices are uploaded
through the Documents app, they're not read, which means the customer
can end up in a situation where read and merge operations (like when
printing a selection of original vendor bills) will fail.

The structural solution for this is to replace PyPDF2 with a more capable
 library, like pikepdf: https://github.com/odoo/odoo/pull/64356 .

This change is too impactful for stable, and there are compatibility
concerns as well.

A possible workaround is merging the PDFs we can and bundling the rest
together in a zip file. This is possible on the level of just
_merge_pdfs, but the PDF extension and mimetype are pretty hard-coded
and the changes required to switch them to ZIP based on what happens in
_merge_pdfs seem too impactful.

Instead, this fix detects as early as possible if the PDFs can't be
read and reports it to the user. The excluded PDFs can still be
downloaded individually. In this way the user has a workaround
and does not need to resort to trial and error to figure out which PDFs
are causing the problem.

Related tickets: 2359929, 2389679

closes odoo/odoo#69082

X-original-commit: e935cf55975e4bbffcfe29dcfe51b3a91dd0aeab
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-09 18:55:54 +00:00
..
2021-02-19 13:20:48 +00:00
…
2021-02-19 13:20:48 +00:00
2021-03-31 13:57:17 +02:00
2021-02-19 13:20:48 +00:00