Skip to content
Snippets Groups Projects
Commit 5eea6b27 authored by jvm-odoo's avatar jvm-odoo Committed by Thibault Delavallée
Browse files

[FIX] website_slides: fix undeletable question answer


Issue

	- Go on Runbot V13
	- eLearning
	- In a course, try to delete a question

	You can't

Cause

	The linked answer is not deleted
	If you want to delete the answer you should
	add an extra menu

Solution

	Add ondelete='cascade' on answer's question_id
	Prevent course deletion if there are attendees

OPW-2210096

closes odoo/odoo#48372

X-original-commit: 799ee72facbca7a7eaf348938ed312a6d723854e
Signed-off-by: default avatarThibault Delavallee (tde) <tde@openerp.com>
parent ca7f780c
Branches
Tags
No related merge requests found
......@@ -457,6 +457,11 @@ class Slide(models.Model):
rec.sequence = 0
return rec
def unlink(self):
if self.question_ids and self.channel_id.channel_partner_ids:
raise UserError(_("People already took this quiz. To keep course progression it should not be deleted."))
super(Slide, self).unlink()
# ---------------------------------------------------------
# Mail/Rating
# ---------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment