Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FW][FIX] website_slides: Stop sending completion mail on all slides removal #159451

Conversation

fw-bot
Copy link
Contributor

@fw-bot fw-bot commented Mar 27, 2024

[FIX] website_slides: Stop sending completion mail on all slides removal

Construct deciding on whetheres an attendee should receive 'complete'
mail, contains a condition which checks if the attendee has:
number_completed_slides >= number of all slides
This however falls into a corner case when there is no slides at all and
computation gets triggered (which got introduced with commit [1] ).

[This Commit Change]

This commit introduces an additional check on the total number of slides in
a channel. Consequently, records without any slides in the related channel
will no longer send completion mail notification.

[Reproduce]

  • Install website_slides
  • Create a new eLearning course with some content but do not publish it.
  • Add attendees.
  • Delete all the content.
  • BUG: emails about finishing the course got sent (Settings/Technical/Emails)

[Why this commit modifies existing test]

The test introduced with commit [2] checks if a specific template is used
in email generation, requiring email generation to occur as a prerequisite.
Originally (before [This Commit Change]), it relied on the default behavior
that considered an attendee a completer even without any published slides,
thus triggering an email. However, after this commit, with a course containing
zero published slides, completion cannot occur, and thus, no emails are sent.

For this reason slight alteration of the test setup is required allowing
for the emails to get sent and in effect the test to perform its role.

[References]

[1] 3efa808
[2] 9a0231d

opw-3703987

Forward-Port-Of: #153178

Construct deciding on whetheres an attendee should receive 'complete'
mail, contains a condition which checks if the attendee has:
number_completed_slides >= number of all slides
This however falls into a corner case when there is no slides at all and
computation gets triggered (which got introduced with commit [1] ).

[This Commit Change]
This commit introduces an additional check on the total number of slides in
a channel. Consequently, records without any slides in the related channel
will no longer send completion mail notification.

[Reproduce]
- Install website_slides
- Create a new eLearning course with some content but do not publish it.
- Add attendees.
- Delete all the content.
- BUG: emails about finishing the course got sent (Settings/Technical/Emails)

[Why this commit modifies existing test]
The test introduced with commit [2] checks if a specific template is used
in email generation, requiring email generation to occur as a prerequisite.
Originally (before [This Commit Change]), it relied on the default behavior
that considered an attendee a completer even without any published slides,
thus triggering an email. However, after this commit, with a course containing
zero published slides, completion cannot occur, and thus, no emails are sent.

For this reason slight alteration of the test setup is required allowing
for the emails to get sent and in effect the test to perform its role.

[References]
[1] odoo@3efa808
[2] odoo@9a0231d

opw-3703987

X-original-commit: 99d360b
@robodoo
Copy link
Contributor

robodoo commented Mar 27, 2024

@fw-bot
Copy link
Contributor Author

fw-bot commented Mar 27, 2024

This PR targets saas-17.2 and is part of the forward-port chain. Further PRs will be created up to master.

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

@robodoo robodoo added the forwardport This PR was created by @fw-bot label Mar 27, 2024
@C3POdoo C3POdoo added the OE the report is linked to a support ticket (opw-...) label Mar 27, 2024
robodoo pushed a commit that referenced this pull request Mar 28, 2024
Construct deciding on whetheres an attendee should receive 'complete'
mail, contains a condition which checks if the attendee has:
number_completed_slides >= number of all slides
This however falls into a corner case when there is no slides at all and
computation gets triggered (which got introduced with commit [1] ).

[This Commit Change]
This commit introduces an additional check on the total number of slides in
a channel. Consequently, records without any slides in the related channel
will no longer send completion mail notification.

[Reproduce]
- Install website_slides
- Create a new eLearning course with some content but do not publish it.
- Add attendees.
- Delete all the content.
- BUG: emails about finishing the course got sent (Settings/Technical/Emails)

[Why this commit modifies existing test]
The test introduced with commit [2] checks if a specific template is used
in email generation, requiring email generation to occur as a prerequisite.
Originally (before [This Commit Change]), it relied on the default behavior
that considered an attendee a completer even without any published slides,
thus triggering an email. However, after this commit, with a course containing
zero published slides, completion cannot occur, and thus, no emails are sent.

For this reason slight alteration of the test setup is required allowing
for the emails to get sent and in effect the test to perform its role.

[References]
[1] 3efa808
[2] 9a0231d

opw-3703987

closes #159451

X-original-commit: 99d360b
Signed-off-by: Andrzej Pietrusiak (pian) <pian@odoo.com>
@robodoo robodoo closed this Mar 28, 2024
@fw-bot fw-bot deleted the saas-17.2-15.0-opw-3703987-channel_shant_get_completed_without_any_slides-pian-Qry0-fw branch April 11, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

4 participants