From 93bd62e44589a320b7c06a07cec5ded2e58f6b9f Mon Sep 17 00:00:00 2001 From: "Levi Siuzdak (sile)" Date: Thu, 30 Nov 2023 16:12:43 +0100 Subject: [PATCH] [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 --- addons/website_event/i18n/website_event.pot | 7 +++++++ addons/website_event/models/event_question.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/addons/website_event/i18n/website_event.pot b/addons/website_event/i18n/website_event.pot index d92d7de387e..fec161f8474 100644 --- a/addons/website_event/i18n/website_event.pot +++ b/addons/website_event/i18n/website_event.pot @@ -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 diff --git a/addons/website_event/models/event_question.py b/addons/website_event/models/event_question.py index 6b7d1f87264..f7437d82b2c 100644 --- a/addons/website_event/models/event_question.py +++ b/addons/website_event/models/event_question.py @@ -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.