Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 5, 2025

To reproduce:

  • on a record of a model that inherits mail.activity.mixin, create a new Activity of a 'meeting' type
  • open calendar
  • create 2 meetings on the calendar
  • only the second one is attached to the resource record's chatter

Problem:
When the calendar view is opened, the mail.activity record has already been created, and creating the calendar.event record writes to its calendar_event_id field with the id of the newly created calendar.event. Creating a second calendar.event record in the same view does not create a second mail.activity record, instead it overwrites the calendar_event_id field of the original mail.activity record, overwriting the original calendar.event. This also causes the first calendar.event record to no longer have any associated mail.activity record in its activity_ids field.

Solution:
In the calender.event create() method, modify the condition of whether a new mail.activity record should get created so that it makes a new mail.activity record if the linked mail.activity record already has a calender_event_id

opw-4500292

I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #199086
Forward-Port-Of: #196719

To reproduce:
- on a record of a model that inherits mail.activity.mixin, create a
  new Activity of a 'meeting' type
- open calendar
- create 2 meetings on the calendar
- only the second one is attached to the resource record's chatter

Problem:
When the calendar view is opened, the mail.activity record has already
been created, and creating the calendar.event record writes to its
calendar_event_id field with the id of the newly created
calendar.event. Creating a second calendar.event record in the same
view does not create a second mail.activity record, instead it
overwrites the calendar_event_id field of the original mail.activity
record, overwriting the original calendar.event. This also causes the
first calendar.event record to no longer have any associated
mail.activity record in its activity_ids field.

Solution:
In the calender.event create() method, modify the condition of whether
a new mail.activity record should get created so that it makes a new
mail.activity record if the linked mail.activity record already has a
calender_event_id

opw-4500292

X-original-commit: 8c911eb
@robodoo
Copy link
Contributor

robodoo commented Mar 5, 2025

Pull request status dashboard

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 5, 2025

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 5, 2025
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 5, 2025
@sast-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Mar 8, 2025
To reproduce:
- on a record of a model that inherits mail.activity.mixin, create a
  new Activity of a 'meeting' type
- open calendar
- create 2 meetings on the calendar
- only the second one is attached to the resource record's chatter

Problem:
When the calendar view is opened, the mail.activity record has already
been created, and creating the calendar.event record writes to its
calendar_event_id field with the id of the newly created
calendar.event. Creating a second calendar.event record in the same
view does not create a second mail.activity record, instead it
overwrites the calendar_event_id field of the original mail.activity
record, overwriting the original calendar.event. This also causes the
first calendar.event record to no longer have any associated
mail.activity record in its activity_ids field.

Solution:
In the calender.event create() method, modify the condition of whether
a new mail.activity record should get created so that it makes a new
mail.activity record if the linked mail.activity record already has a
calender_event_id

opw-4500292

closes #200485

X-original-commit: 8c911eb
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Samuel Struble (sast) <sast@odoo.com>
@robodoo robodoo added the 18.3 label Mar 8, 2025
@robodoo robodoo closed this Mar 8, 2025
@fw-bot fw-bot deleted the master-16.0-opw-4500292-calendar_activities_events-sast-420769-fw branch March 15, 2025 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

18.3 forwardport This PR was created by @fw-bot OE the report is linked to a support ticket (opw-...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants