Browse Source

[ADD] survey_details module

12.0
Rémi FRANÇOIS 5 years ago
parent
commit
026df698f8
  1. 1
      survey_details/__init__.py
  2. 34
      survey_details/__manifest__.py
  3. 41
      survey_details/i18n/fr.po
  4. 42
      survey_details/i18n/survey_details.pot
  5. 1
      survey_details/models/__init__.py
  6. 7
      survey_details/models/survey_survey.py
  7. 17
      survey_details/templates/survey_init.xml
  8. 19
      survey_details/views/survey_page.xml
  9. 21
      survey_details/views/survey_survey.xml

1
survey_details/__init__.py

@ -0,0 +1 @@
from . import models

34
survey_details/__manifest__.py

@ -0,0 +1,34 @@
# -*- coding: utf-8 -*-
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Survey details',
'version': '1.0.0',
'summary': """
This module adds a new tab in the survey form to customize the answer start template.
""",
'description': """ """,
'author': 'Sudokeys',
'website': 'http://www.sudokeys.com',
'license': 'AGPL-3',
'category': 'Marketing',
'depends': [
'survey',
],
'data': [
'templates/survey_init.xml',
'views/survey_page.xml',
'views/survey_survey.xml',
],
'demo': [],
'auto_install': False,
'external_dependencies': [],
'application': False,
'css': [],
'images': [],
'js': [],
'installable': True,
'maintainer': 'Sudokeys',
'pre_init_hook': '',
'post_init_hook': '',
'uninstall_hook': '',
}

41
survey_details/i18n/fr.po

@ -0,0 +1,41 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_details
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-23 21:21+0000\n"
"PO-Revision-Date: 2020-03-23 21:21+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_details
#: model_terms:ir.ui.view,arch_db:survey_details.survey_survey_form
msgid "Details"
msgstr "Détails"
#. module: survey_details
#: model_terms:ir.ui.view,arch_db:survey_details.survey_init
msgid "Start Survey"
msgstr "Commencer le sondage"
#. module: survey_details
#: model:ir.model.fields,field_description:survey_details.field_survey_survey__button_label
msgid "Start button label"
msgstr "Label du bouton"
#. module: survey_details
#: model:ir.model,name:survey_details.model_survey_survey
msgid "Survey"
msgstr "Sondage"
#. module: survey_details
#: model:ir.model.fields,help:survey_details.field_survey_survey__button_label
msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"."
msgstr "Ce label est utilisé dans le bouton au début du sondage. Si ce champ est vide, le label sera \"Commencer le sondage\""

42
survey_details/i18n/survey_details.pot

@ -0,0 +1,42 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_details
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2020-03-23 21:22+0000\n"
"PO-Revision-Date: 2020-03-23 21:22+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_details
#: model_terms:ir.ui.view,arch_db:survey_details.survey_survey_form
msgid "Details"
msgstr ""
#. module: survey_details
#: model_terms:ir.ui.view,arch_db:survey_details.survey_init
msgid "Start Survey"
msgstr ""
#. module: survey_details
#: model:ir.model.fields,field_description:survey_details.field_survey_survey__button_label
msgid "Start button label"
msgstr ""
#. module: survey_details
#: model:ir.model,name:survey_details.model_survey_survey
msgid "Survey"
msgstr ""
#. module: survey_details
#: model:ir.model.fields,help:survey_details.field_survey_survey__button_label
msgid "This label will be used in the survey start button. If empty, the label will be \"Start survey\"."
msgstr ""

1
survey_details/models/__init__.py

@ -0,0 +1 @@
from . import survey_survey

7
survey_details/models/survey_survey.py

@ -0,0 +1,7 @@
from odoo import models, fields
class SurveySurvey(models.Model):
_inherit = 'survey.survey'
button_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\".")

17
survey_details/templates/survey_init.xml

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="survey_init" inherit_id="survey.survey_init">
<a role="button" position="replace">
<a role="button" class="btn btn-primary btn-lg" t-att-href="'/survey/fill/%s/%s' % (slug(survey), token)">
<t t-if="survey.button_label">
<span t-field="survey.button_label"/>
</t>
<t t-else="">
Start Survey
</t>
</a>
</a>
</template>
</odoo>

19
survey_details/views/survey_page.xml

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_page_form" model="ir.ui.view">
<field name="name">survey_details survey.page form</field>
<field name="model">survey.page</field>
<field name="inherit_id" ref="survey.survey_page_form"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<h1 position="after">
<label for="description" class="oe_edit_only"/>
</h1>
<field name="question_ids" position="before">
<field name="description" nolabel="1" colspan="2"/>
</field>
</field>
</record>
</odoo>

21
survey_details/views/survey_survey.xml

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="survey_survey_form" model="ir.ui.view">
<field name="name">survey_details survey.survey form</field>
<field name="model">survey.survey</field>
<field name="inherit_id" ref="survey.survey_form"/>
<field name="priority">20</field>
<field name="arch" type="xml">
<xpath expr="//notebook/page[1]" position="after">
<page name="details" string="Details">
<group>
<field name="button_label"/>
<field name="description" colspan="2"/>
</group>
</page>
</xpath>
</field>
</record>
</odoo>
Loading…
Cancel
Save