Skip to content
Snippets Groups Projects
Commit 81215120 authored by Nans Lefebvre's avatar Nans Lefebvre
Browse files

Revert "[FIX] mail: remove attachment as main at unlink"


This reverts commit abc45b19
Since by default the ondelete attribute of a many2one is `set null`,
this was completely unnecessary to begin with.

Bug caused by this commit:
Unlink a record that has some attachments.
The unlink first removes the record, then its related attachments.
It calls remove_as_main_attachment, which reads the attachment res_model and
res_id. This triggers a check that the related record can be read.
However the related record has already been removed, an exception is raised.
It is thus impossible to unlink a record.

Closes #32563

closes odoo/odoo#32572

Signed-off-by: default avatarRaphael Collet (rco) <rco@openerp.com>
parent c43acc34
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment