OCA / calendar

GNU Affero General Public License v3.0
24 stars 94 forks source link

[16.0][IMP] resource_booking: Add support for mail_note subtype by default #129

Closed victoralmau closed 5 months ago

victoralmau commented 5 months ago

Add support for mail_note subtype by default

If we are creating the calendar event from resource booking, we want to notify only the partner_ids and not all followers (to avoid that each email is sent to all followers). Example: Resource booking with combination of several users. This happens only when the the subtype not is enabled by default in the instance.

Related to https://github.com/OCA/calendar/pull/127/commits/a3cd5a883b809237150e0da3247f68f02f4b4c4c

Please @pedrobaeza can you review it?

@Tecnativa TT49045

OCA-git-bot commented 5 months ago

Hi @ows-cloud, @pedrobaeza, some modules you are maintaining are being modified, check this out!

victoralmau commented 5 months ago

Isn't better to delay the subscription of the resources for avoiding both problems?

On the commit message, please change related to by complement of, as it's not the same.

Followers are added when creating the calendar.attendee (https://github.com/odoo/odoo/blob/16.0/addons/calendar/models/calendar_attendee.py#L69C19-L69C37), if you prefer we can do that approach (delete the existing followers of mail_note subtype from all attendee created before and add them later).

pedrobaeza commented 5 months ago

What I still don't understand is why doing a manual calendar event with multiple attendees, this is not happening. Why can't we mimic what standard does there?

victoralmau commented 5 months ago

Yes, it is possible for this to happen with a manual event.

Steps to reproduce it.

example

Do you think this is something that should be resolved in calendar?

pedrobaeza commented 5 months ago

Let's keep it this way, as to get it upstream will be difficult, and mangle with followers will be difficult.

OCA-git-bot commented 5 months ago

Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 16.0-ocabot-merge-pr-129-by-pedrobaeza-bump-patch, awaiting test results.

OCA-git-bot commented 5 months ago

@pedrobaeza The merge process could not be finalized, because command git push origin 16.0-ocabot-merge-pr-129-by-pedrobaeza-bump-patch:16.0 failed with output:

To https://github.com/OCA/calendar
 ! [rejected]        16.0-ocabot-merge-pr-129-by-pedrobaeza-bump-patch -> 16.0 (fetch first)
error: failed to push some refs to 'https://***@github.com/OCA/calendar'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
OCA-git-bot commented 5 months ago

Congratulations, your PR was merged at 8319f3c5e5061252284362028b7db83df7b79864. Thanks a lot for contributing to OCA. ❤️