diff --git a/survey_pass_fail_messages/__init__.py b/survey_pass_fail_messages/__init__.py new file mode 100644 index 0000000..0650744 --- /dev/null +++ b/survey_pass_fail_messages/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/survey_pass_fail_messages/__manifest__.py b/survey_pass_fail_messages/__manifest__.py new file mode 100644 index 0000000..d814aeb --- /dev/null +++ b/survey_pass_fail_messages/__manifest__.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html). +{ + "name": "Survey score message", + "version": "1.0.0", + "summary": """ + Add score specific message to survey done page + """, + "description": """ + This module adds 2 text fiels on surveys that are displayed according to the succes (or fail) regarding the score. + """, + "author": "RemiFr82", + "contributors": "", + "maintainer": "RemiFr82", + "website": "https://remifr82.me", + "license": "LGPL-3", + "category": "Marketing", + # "price": 0, + # "currency": "EUR", + "application": False, + "installable": True, + "auto_install": False, + "pre_init_hook": "", + "post_init_hook": "", + "uninstall_hook": "", + "excludes": [], + "external_dependencies": [], + "depends": [ + "survey", + ], + "data": [ + "views/survey_survey.xml", + "views/survey_templates.xml", + ], + "css": [], + "images": [], + "js": [], + "test": [], + "demo": [], +} diff --git a/survey_pass_fail_messages/i18n/fr.po b/survey_pass_fail_messages/i18n/fr.po new file mode 100644 index 0000000..b961529 --- /dev/null +++ b/survey_pass_fail_messages/i18n/fr.po @@ -0,0 +1,77 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * survey_pass_fail_messages +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0-20230613\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-12-22 14:49+0000\n" +"PO-Revision-Date: 2024-12-22 14:49+0000\n" +"Last-Translator: \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: survey_pass_fail_messages +#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form +msgid "" +"Certification failed end message (following the standard \"Unfortunately, " +"you have failed the test.\" message)" +msgstr "" +"Message de fin en cas d'échec (inséré après le message \"Malheureusement, " +"vous avez raté le test.\")" + +#. module: survey_pass_fail_messages +#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form +msgid "" +"Certification passed end message (following the standard \"Congratulations, " +"you have passed the test!\" message)" +msgstr "" +"Message de fin en cas de réussite (inséré après le message \"Félicitations, " +"vous avez réussi le test !\")" + +#. module: survey_pass_fail_messages +#: model:ir.model.fields,field_description:survey_pass_fail_messages.field_survey_survey__description_done_fail +msgid "Failed end message" +msgstr "Message d'échec" + +#. module: survey_pass_fail_messages +#: model:ir.model.fields,field_description:survey_pass_fail_messages.field_survey_survey__description_done_pass +msgid "Passed end message" +msgstr "Message de réussite" + +#. module: survey_pass_fail_messages +#: model:ir.model,name:survey_pass_fail_messages.model_survey_survey +msgid "Survey" +msgstr "Sondage" + +#. module: survey_pass_fail_messages +#: model:ir.model.fields,help:survey_pass_fail_messages.field_survey_survey__description_done_fail +msgid "" +"This message will be displayed when survey is completed and the user failed " +"the test." +msgstr "" +"Ce message sera affiché quand le sondage est terminé si l'utilisateur rate " +"le test." + +#. module: survey_pass_fail_messages +#: model:ir.model.fields,help:survey_pass_fail_messages.field_survey_survey__description_done_pass +msgid "" +"This message will be displayed when survey is completed and the user passed " +"the test." +msgstr "" +"Ce message sera affiché quand le sondage est terminé si l'utilisateur " +"réussit le test." + +#. module: survey_pass_fail_messages +#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form +msgid "e.g. \"Passing the test gives you the possibility to...\"" +msgstr "ex. \"Réussir ce test vous permet de...\"" + +#. module: survey_pass_fail_messages +#: model_terms:ir.ui.view,arch_db:survey_pass_fail_messages.survey_survey_form +msgid "e.g. \"You can retry this test after...\"" +msgstr "ex. \"Vous pourrez retenter ce test après...\"" diff --git a/survey_pass_fail_messages/models/__init__.py b/survey_pass_fail_messages/models/__init__.py new file mode 100644 index 0000000..38d56b9 --- /dev/null +++ b/survey_pass_fail_messages/models/__init__.py @@ -0,0 +1 @@ +from . import survey_survey diff --git a/survey_pass_fail_messages/models/survey_survey.py b/survey_pass_fail_messages/models/survey_survey.py new file mode 100644 index 0000000..9c721dc --- /dev/null +++ b/survey_pass_fail_messages/models/survey_survey.py @@ -0,0 +1,17 @@ +from odoo import models, fields, api, _ +from odoo.exceptions import UserError + + +class SurveySurvey(models.Model): + _inherit = "survey.survey" + + description_done_pass = fields.Html( + string="Passed end message", + translate=True, + help="This message will be displayed when survey is completed and the user passed the test.", + ) + description_done_fail = fields.Html( + string="Failed end message", + translate=True, + help="This message will be displayed when survey is completed and the user failed the test.", + ) diff --git a/survey_pass_fail_messages/views/survey_survey.xml b/survey_pass_fail_messages/views/survey_survey.xml new file mode 100644 index 0000000..91552e4 --- /dev/null +++ b/survey_pass_fail_messages/views/survey_survey.xml @@ -0,0 +1,25 @@ + + + + + + + survey_template survey.survey form + survey.survey + + 22 + + + + + diff --git a/survey_pass_fail_messages/views/survey_templates.xml b/survey_pass_fail_messages/views/survey_templates.xml new file mode 100644 index 0000000..3aa197d --- /dev/null +++ b/survey_pass_fail_messages/views/survey_templates.xml @@ -0,0 +1,15 @@ + + + + + + + +