[FIX] website_event: make non-sensical error make sense
Whether a question can belong to itself is too philosophical of a question for an error pop-up. opw-3572599 X-original-commit: c798bbbde6fc6e8e42e144f90c163a2ae40a49b8 Part-of: odoo/odoo#144451
This commit is contained in:
@@ -1034,6 +1034,13 @@ msgstr ""
|
||||
msgid "Question Type"
|
||||
msgstr ""
|
||||
|
||||
#. module: website_event
|
||||
#. odoo-python
|
||||
#: code:addons/website_event/models/event_question.py:0
|
||||
#, python-format
|
||||
msgid "Question cannot be linked to both an Event and an Event Type."
|
||||
msgstr ""
|
||||
|
||||
#. module: website_event
|
||||
#. odoo-python
|
||||
#: code:addons/website_event/models/event_question.py:0
|
||||
|
||||
@@ -32,7 +32,7 @@ class EventQuestion(models.Model):
|
||||
@api.constrains('event_type_id', 'event_id')
|
||||
def _constrains_event(self):
|
||||
if any(question.event_type_id and question.event_id for question in self):
|
||||
raise UserError(_('Question cannot belong to both the event category and itself.'))
|
||||
raise UserError(_("Question cannot be linked to both an Event and an Event Type."))
|
||||
|
||||
def write(self, vals):
|
||||
""" We add a check to prevent changing the question_type of a question that already has answers.
|
||||
|
||||
Reference in New Issue
Block a user