Steps to reproduce:
-------------------
- install calendar, project and documents;
- create an activity for a task (project.task) with meeting type;
- change attendee to the meeting;
- save;
Issue:
------
The activity is not linked to the right task.
Cause:
------
When we create a `calendar.event`, when the event is at a future date,
we send an email to the attendees.
This email must include an attachment corresponding to the ICS file.
Depending on the `no_document` context key, we may or may not create a document.
When we create the document, we have a value for the `activity_ids` field (one2many)
which is the ORM command for linking the newly created document.
This will result in the document id being written to the `res_id` field
of the `mail.activity` record.
Unfortunately, the activity contains a `res_model` which is not `documents.document`.
The result is that the activity is linked to a `res_id` which is not
that of the model previously set for it (i.e. `project.task`).
Solution:
---------
Add context key `no_document` when creating an attachment for ICS files.
opw-3746857
closesodoo/odoo#158570
X-original-commit: 17ac8d3f25bad2c4f37793e06edca40793a4f3d5
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>