Commit Graph
7 Commits
Author SHA1 Message Date
Stanislas Sobieski 82e8c74f1e [FIX] base: avoid indexing attachment on copy
When sending a mass mailing with a pdf attachment, the ir.attachment
is copied in the mail.composer for each email. Spending time and
resources in the indexing of the pdf. On copy that value is already in
the vals. This is especially true when attachment_indexation is
installed, processing the pdf documents can be costly with pdfminer.

It could also be done by overwriting the copu from ir_attachment but it
could happen a misuse of mass create of ir.attachment with the same file
has the same issue

closes odoo/odoo#100374

X-original-commit: 3d59cc849ed1040c08c4d1488866ba78c80990c8
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-09-17 00:51:32 +02:00
Ivan Yelizariev adec68caa7 [FIX] attachment_indexation: fix error "cannot contain NUL (0x00)"
To reproduce:

* install python package ``pdfminer.six``
* install module attachment_indexation
* upload special attachment

BEFORE:

Error in client:

> TypeError: relatedTemporaryAttachments is not iterable

Error in logs:

> ValueError: A string literal cannot contain NUL (0x00) characters.

AFTER:

No errors

---

opw-2506038

closes odoo/odoo#70205

X-original-commit: 172b88fdd955ba591a9bdd5a93bf7285ce0e6520
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-04-30 17:04:38 +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
Thanh Dodeur c212cfe899 [REF] *: removes datas_fname from ir.attachment
This commit removes the field `datas_fname` from `ir.attachment` as
it was unnecessary and most of the time the duplicate of `name` or
`url`.

Task #1909865

closes odoo/odoo#32976

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-05 09:12:13 +00:00
Christophe Simonis f927c68ddb [MERGE] forward port branch 12.0 up to cb8fefa899 2019-01-31 16:59:58 +01:00
ThanhDodeurOdoo adab361fb5 [REF] document, attachment_indexation: renames the module document
This commit renames the module document into attachment_indexation
to provide a more descriptive name and avoid confusion with
enterprise's documents module.

task: #1908896
2018-12-06 19:09:34 +00:00