Skip to content
Permalink
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

X-original-commit: 799ee72
  • Loading branch information
jvm-odoo authored and tde-banana-odoo committed Mar 16, 2020
1 parent e4ebd3e commit 48a7ed0126079a0cb8db25f58402471a271617c7
Showing with 5 additions and 0 deletions.
  1. +5 −0 addons/website_slides/models/slide_slide.py
@@ -457,6 +457,11 @@ def copy(self, default=None):
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 comments on commit 48a7ed0

Please sign in to comment.
You can’t perform that action at this time.