Skip to content

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Feb 14, 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: #196719

@robodoo
Copy link
Contributor

robodoo commented Feb 14, 2025

Pull request status dashboard

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Feb 14, 2025
@fw-bot
Copy link
Contributor Author

fw-bot commented Feb 14, 2025

@sast-odoo @arj-odoo cherrypicking of pull request #196719 failed.

stdout:

Auto-merging addons/calendar/models/calendar_event.py
Auto-merging addons/calendar/models/mail_activity.py
CONFLICT (content): Merge conflict in addons/calendar/models/mail_activity.py
Auto-merging addons/calendar/tests/test_calendar.py
CONFLICT (content): Merge conflict in addons/calendar/tests/test_calendar.py

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

⚠️ after resolving this conflict, you will need to merge it via @robodoo.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@robodoo robodoo added the conflict There was an error while creating this forward-port PR label Feb 14, 2025
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Feb 14, 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

X-original-commit: eec3fe3
@sast-odoo sast-odoo force-pushed the 17.0-16.0-opw-4500292-calendar_activities_events-sast-414419-fw branch from 809c43f to 1bcbb7e Compare February 14, 2025 21:10
@C3POdoo C3POdoo requested a review from a team February 14, 2025 21:12
@fw-bot
Copy link
Contributor Author

fw-bot commented Feb 22, 2025

@sast-odoo @arj-odoo this forward port of #196719 is awaiting action (not merged or closed).

@arj-odoo
Copy link
Contributor

@robodoo r+

robodoo pushed a commit that referenced this pull request Feb 24, 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 #197761

X-original-commit: eec3fe3
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
@robodoo robodoo closed this Feb 24, 2025
@xmo-odoo xmo-odoo deleted the 17.0-16.0-opw-4500292-calendar_activities_events-sast-414419-fw branch March 7, 2025 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

conflict There was an error while creating this forward-port PR 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.

5 participants