When being in a partner record (res.partner) and composing / sending a message (email) to the partner from the chatter and attaching a attachment ( e.g. PDF ) this attachment is linked to
- the mail.message record and
- to the partner (res.partner record)
If I goto Technical / Messages I find the sent message there with the attachment(s).
In addition on the partner record this attachment (belonging to the message) is linked to the partner as well.
This is because in the record in ir.attachment the fields
- "res.model" is filled with "res.partner" and
- "res.id" is filled with the ID of the partner
The same happens, if a have an incoming mailserver configured to create a new message for every fetched email. All attachments are linked to the messages as well as to records in res.partner related to this message(s) ...
Does anybody know how to avoid that attachments coming from messages are linked to partner records - in other words: where do I have to inherit what to prevent the fields "res.model" and "res.id" in ir.attachments are filled as they are ...