Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] hr_expense: Fix auto-extraction of attachments.
Problem --------- In the commit 2434581 (odoo), we modified the extraction of attachment in such a way that mails coming in a journal from aliases with several attachments create several invoices. Due to the urgency of the task, the computation of whether an attachment needs auto-extraction or not, has been skipped which failing some tests that had been silenced. Linked PR odoo#49816 (enterprise) fixes it. However, as a comment on the said PR suggested, we should add a context key that disable the auto-extraction. Objective --------- Add a context key that disable the auto-extraction and update commit 2bfe69be5c64743d0bf35793a427878170d0b3c6 (enterprise) to use the said context key. Solution --------- 1. Remove the override of the `_needs_auto_extract` 2. Manually set the main attachment of the created moves so that `register_as_main_attachment` is not called when accessing the move. This removes the auto-extraction without the need to use the key (we still keep the context key as suggested by the OCR team). closes odoo#149525 Related: odoo/enterprise#49816 Signed-off-by: Laurent Smet (las) <las@odoo.com>
- Loading branch information