Commit Graph
3 Commits
Author SHA1 Message Date
Martin Trigaux 22ab49e343 [IMP] *: use file_path and file_open
Replace all the calls to get_resource_path to the better file_path or
directly use file_open when not needed

Doing both a get_resource_path and file_open means checking twice that
the file exists.
Doing a simple path concatenation before a file_open is safe.
If given to another method (e.g. etree.parse), calling file_path is
the prefered method.

Note that get_resource_path used to return False when the file does
not exists while file_path/file_open raises a FileNotFoundException

closes odoo/odoo#135607

Related: odoo/upgrade#5187
Related: odoo/enterprise#47475
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-06 14:33:43 +00:00
Christophe Monniez 6fa4dbf204 [FIX] attachement_indexation: make pdfminer optional
As pdfminer does not have a Debian package in Ubuntu Bionic, it cannot
be declared as a strong requirement.

With this commit, a warning is logged if the library is not installed.
It does not prevent to index other types of documents.

closes odoo/odoo#44327

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-01-31 14:37:56 +00:00
len-odoo 183af97168 [IMP] attachment_indexation: improved PDF text extraction
PyPDF performs badly on many types of PDF documents.
We add a text extraction with pdfminer, which is designed for this task.
Because pdf content extraction was so flaky, it was completely
deactivated by 1b753b0d53. We revert that :-)

closes odoo/odoo#38508

Task: 2152494
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-01-29 10:26:46 +00:00