Browse Source

[ADD] sumbit button label in survey_input_template_custom

12.0
Rémi FRANÇOIS 5 years ago
parent
commit
bbb20ded7a
  1. 3
      survey_input_template_custom/__manifest__.py
  2. 21
      survey_input_template_custom/i18n/fr.po
  3. 20
      survey_input_template_custom/i18n/survey_input_template_custom.pot
  4. 2
      survey_input_template_custom/models/survey_survey.py
  5. 17
      survey_input_template_custom/templates/page.xml
  6. 1
      survey_input_template_custom/views/survey_survey.xml

3
survey_input_template_custom/__manifest__.py

@ -1,7 +1,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{ {
'name': 'Survey input templates custom',
'name': 'Survey input custom',
'version': '1.0.0', 'version': '1.0.0',
'summary': """ 'summary': """
This module allows to customize the survey start button label and the \"Thank you\" page title. This module allows to customize the survey start button label and the \"Thank you\" page title.
@ -15,6 +15,7 @@
'survey', 'survey',
], ],
'data': [ 'data': [
'templates/page.xml',
'templates/sfinished.xml', 'templates/sfinished.xml',
'templates/survey_init.xml', 'templates/survey_init.xml',
'views/survey_survey.xml', 'views/survey_survey.xml',

21
survey_input_template_custom/i18n/fr.po

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n" "Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-25 11:41+0000\n"
"PO-Revision-Date: 2020-03-25 11:41+0000\n"
"POT-Creation-Date: 2020-03-25 23:45+0000\n"
"PO-Revision-Date: 2020-03-25 23:45+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -23,7 +23,17 @@ msgstr "Commencer le sondage"
#. module: survey_input_template_custom #. module: survey_input_template_custom
#: model:ir.model.fields,field_description:survey_input_template_custom.field_survey_survey__start_btn_label #: model:ir.model.fields,field_description:survey_input_template_custom.field_survey_survey__start_btn_label
msgid "Start button label" msgid "Start button label"
msgstr "Label du bouton"
msgstr "Bouton \"Commencer\""
#. module: survey_input_template_custom
#: model:ir.model.fields,field_description:survey_input_template_custom.field_survey_survey__submit_btn_label
msgid "Submit button label"
msgstr "Bouton \"Soumettre\""
#. module: survey_input_template_custom
#: model_terms:ir.ui.view,arch_db:survey_input_template_custom.page
msgid "Submit survey"
msgstr "Soumettre le sondage"
#. module: survey_input_template_custom #. module: survey_input_template_custom
#: model:ir.model,name:survey_input_template_custom.model_survey_survey #: model:ir.model,name:survey_input_template_custom.model_survey_survey
@ -45,6 +55,11 @@ msgstr "Merci !"
msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"." msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"."
msgstr "Ce label sera utilisé dans le bouton au début du sondage. Si ce champ est vide, le label sera \"Commencer le sondage\"." msgstr "Ce label sera utilisé dans le bouton au début du sondage. Si ce champ est vide, le label sera \"Commencer le sondage\"."
#. module: survey_input_template_custom
#: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__submit_btn_label
msgid "This label will be used in the survey submit button. If empty, the label will be \"Submit survey\"."
msgstr "Ce label sera utilisé dans le bouton pour soumettre la réponse. Si ce champ est vide, le label sera \"Soumettre le sondage\"."
#. module: survey_input_template_custom #. module: survey_input_template_custom
#: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__thank_you_title #: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__thank_you_title
msgid "This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\"." msgid "This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\"."

20
survey_input_template_custom/i18n/survey_input_template_custom.pot

@ -6,8 +6,8 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n" "Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-25 11:42+0000\n"
"PO-Revision-Date: 2020-03-25 11:42+0000\n"
"POT-Creation-Date: 2020-03-25 23:45+0000\n"
"PO-Revision-Date: 2020-03-25 23:45+0000\n"
"Last-Translator: <>\n" "Last-Translator: <>\n"
"Language-Team: \n" "Language-Team: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
@ -25,6 +25,16 @@ msgstr ""
msgid "Start button label" msgid "Start button label"
msgstr "" msgstr ""
#. module: survey_input_template_custom
#: model:ir.model.fields,field_description:survey_input_template_custom.field_survey_survey__submit_btn_label
msgid "Submit button label"
msgstr ""
#. module: survey_input_template_custom
#: model_terms:ir.ui.view,arch_db:survey_input_template_custom.page
msgid "Submit survey"
msgstr ""
#. module: survey_input_template_custom #. module: survey_input_template_custom
#: model:ir.model,name:survey_input_template_custom.model_survey_survey #: model:ir.model,name:survey_input_template_custom.model_survey_survey
msgid "Survey" msgid "Survey"
@ -45,8 +55,12 @@ msgstr ""
msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"." msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"."
msgstr "" msgstr ""
#. module: survey_input_template_custom
#: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__submit_btn_label
msgid "This label will be used in the survey submit button. If empty, the label will be \"Submit survey\"."
msgstr ""
#. module: survey_input_template_custom #. module: survey_input_template_custom
#: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__thank_you_title #: model:ir.model.fields,help:survey_input_template_custom.field_survey_survey__thank_you_title
msgid "This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\"." msgid "This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\"."
msgstr "" msgstr ""

2
survey_input_template_custom/models/survey_survey.py

@ -6,5 +6,7 @@ class SurveySurvey(models.Model):
start_btn_label = fields.Char(string="Start button label", start_btn_label = fields.Char(string="Start button label",
help="This label will be used in the survey start button. If empty, the label will be \"Start survey\".") help="This label will be used in the survey start button. If empty, the label will be \"Start survey\".")
submit_btn_label = fields.Char(string="Submit button label",
help="This label will be used in the survey submit button. If empty, the label will be \"Submit survey\".")
thank_you_title = fields.Char(string="Thank you page title", thank_you_title = fields.Char(string="Thank you page title",
help="This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\".") help="This title will be used in the survey \"Thank you\" page. If empty, the label will be \"Thank you !\".")

17
survey_input_template_custom/templates/page.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="page" inherit_id="survey.page">
<xpath expr="//button[@t-if='last']" position="replace">
<button t-if="last" type="submit" class="btn btn-primary" name="button_submit" value="finish">
<t t-if="survey.submit_btn_label">
<span t-field="survey.submit_btn_label"/>
</t>
<t t-else="">
Submit survey
</t>
</button>
</xpath>
</template>
</odoo>

1
survey_input_template_custom/views/survey_survey.xml

@ -11,6 +11,7 @@
<group col="4"> <group col="4">
<field name="start_btn_label"/> <field name="start_btn_label"/>
<field name="thank_you_title"/> <field name="thank_you_title"/>
<field name="submit_btn_label"/>
</group> </group>
</xpath> </xpath>
</field> </field>

Loading…
Cancel
Save