[FIX] website_slides: leaving a course unsubs from the related channel

Steps to reproduce:
- install eLearning
- go to the website > courses > enroll in any course > leave the course

Previous behavior:
you are not unsubscribed from the slide channel and still receive mail
notifications

Current behavior:
you are unsubscribed from the channel when you leave the course

opw-2244716

closes odoo/odoo#50404

X-original-commit: cb262738a20fad3e5114e9df21b77f499347745e
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
This commit is contained in:
jerome hanke (jhk)
2020-04-29 14:53:28 +00:00
parent 4b289bfd3f
commit ffe119d03e
@@ -567,6 +567,7 @@ class Channel(models.Model):
[('partner_id', 'in', partner_ids),
('channel_id', '=', channel.id)]
])
self.message_unsubscribe(partner_ids=partner_ids)
if removed_channel_partner_domain:
self.env['slide.channel.partner'].sudo().search(removed_channel_partner_domain).unlink()