Skip to content

Commit

Permalink
[ADD] survey_answer_generation: New module
Browse files Browse the repository at this point in the history
TT40984
  • Loading branch information
chienandalu committed Nov 16, 2023
1 parent 28039be commit 94fd821
Show file tree
Hide file tree
Showing 20 changed files with 1,008 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup/survey_answer_generation/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
106 changes: 106 additions & 0 deletions survey_answer_generation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
========================
Survey answer generation
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:da1a7732ef0ce8ab777f5ecbeb5ce0e4bb3c248b1675c62d24c276dedbd4c74f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsurvey-lightgray.png?logo=github
:target: https://github.com/OCA/survey/tree/15.0/survey_answer_generation
:alt: OCA/survey
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/survey-15-0/survey-15-0-survey_answer_generation
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/survey&target_branch=15.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module allows to prefill answers from one survey to another.

**Table of contents**

.. contents::
:local:

Configuration
=============

You can configure either a new or an existing survey.

#. Go to *Surveys* and choose an existing one or create it.
#. In the *Options* tab, *Questions* group, choose the *Next Survey*.

Now you'll have to configure the destination questions linked to this survey's questions.

For regular questions (text, numerical, date):

#. In the *Answers* tab choose the linked questions.

Usage
=====

Once the survey is configured, the users can fill them up as usual. The answers in the
next survey will be prefilled according to the linked questions.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/survey/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/survey/issues/new?body=module:%20survey_answer_generation%0Aversion:%2015.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Tecnativa

Contributors
~~~~~~~~~~~~

* `Tecnativa <https://www.tecnativa.com>`_

* David Vidal

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

.. |maintainer-chienandalu| image:: https://github.com/chienandalu.png?size=40px
:target: https://github.com/chienandalu
:alt: chienandalu

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-chienandalu|

This module is part of the `OCA/survey <https://github.com/OCA/survey/tree/15.0/survey_answer_generation>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions survey_answer_generation/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
19 changes: 19 additions & 0 deletions survey_answer_generation/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Survey answer generation",
"summary": "Pre-generate answers from another survey",
"version": "15.0.1.0.0",
"development_status": "Beta",
"category": "Marketing/Survey",
"website": "https://github.com/OCA/survey",
"author": "Tecnativa, Odoo Community Association (OCA)",
"maintainers": ["chienandalu"],
"license": "AGPL-3",
"depends": ["survey"],
"data": [
"views/survey_question_views.xml",
"views/survey_survey_views.xml",
"views/survey_user_input_views.xml",
],
}
104 changes: 104 additions & 0 deletions survey_answer_generation/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_answer_generation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-16 15:06+0000\n"
"PO-Revision-Date: 2023-11-16 16:11+0100\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: es\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4\n"

#. module: survey_answer_generation
#: code:addons/survey_answer_generation/models/survey_user_input.py:0
#, python-format
msgid "Current"
msgstr "Actual"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__diff_user_input_line_count
msgid "Diff User Input Line Count"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input_line__diff_with_origin
msgid "Diff With Origin"
msgstr "Diferencias con el original"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question__next_survey_id
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_survey__next_survey_id
msgid "Next Survey"
msgstr "Próxima encuesta"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__next_survey_input_id
msgid "Next Survey Input"
msgstr "Respuestas de la próxima encuesta"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question__next_survey_question_id
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question_answer__next_survey_question_id
msgid "Next Survey Question"
msgstr "Pregunta de la próxima encuesta"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question_answer__next_survey_question_answer_id
msgid "Next Survey Question Answer"
msgstr "Respuesta a la pregunta de la próxima encuesta"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__origin_input_id
msgid "Origin Input"
msgstr "Respuestas de origen"

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input_line__origin_input_line
msgid "Origin Input Line"
msgstr "Línea de repuestas de origen"

#. module: survey_answer_generation
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question__next_survey_question_id
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question_answer__next_survey_question_answer_id
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question_answer__next_survey_question_id
msgid "Prefill this answer of the next survey with the answer of this one"
msgstr "Rellenar previamente la respuesta de la próxima encuesta con la respuesta de esta"

#. module: survey_answer_generation
#: code:addons/survey_answer_generation/models/survey_user_input.py:0
#, python-format
msgid "Previous"
msgstr "Anterior"

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_survey
msgid "Survey"
msgstr "Encuesta"

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_question_answer
msgid "Survey Label"
msgstr "Etiqueta de la encuesta"

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_question
msgid "Survey Question"
msgstr "Pregunta de la encuesta"

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_user_input
msgid "Survey User Input"
msgstr "Entrada de usuario de la encuesta"

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_user_input_line
msgid "Survey User Input Line"
msgstr "Línea de entrada de usuario de la encuesta"
102 changes: 102 additions & 0 deletions survey_answer_generation/i18n/survey_answer_generation.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * survey_answer_generation
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-11-16 15:05+0000\n"
"PO-Revision-Date: 2023-11-16 15:05+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_answer_generation
#: code:addons/survey_answer_generation/models/survey_user_input.py:0
#, python-format
msgid "Current"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__diff_user_input_line_count
msgid "Diff User Input Line Count"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input_line__diff_with_origin
msgid "Diff With Origin"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question__next_survey_id
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_survey__next_survey_id
msgid "Next Survey"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__next_survey_input_id
msgid "Next Survey Input"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question__next_survey_question_id
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question_answer__next_survey_question_id
msgid "Next Survey Question"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_question_answer__next_survey_question_answer_id
msgid "Next Survey Question Answer"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input__origin_input_id
msgid "Origin Input"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,field_description:survey_answer_generation.field_survey_user_input_line__origin_input_line
msgid "Origin Input Line"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question__next_survey_question_id
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question_answer__next_survey_question_answer_id
#: model:ir.model.fields,help:survey_answer_generation.field_survey_question_answer__next_survey_question_id
msgid "Prefill this answer of the next survey with the answer of this one"
msgstr ""

#. module: survey_answer_generation
#: code:addons/survey_answer_generation/models/survey_user_input.py:0
#, python-format
msgid "Previous"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_survey
msgid "Survey"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_question_answer
msgid "Survey Label"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_question
msgid "Survey Question"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_user_input
msgid "Survey User Input"
msgstr ""

#. module: survey_answer_generation
#: model:ir.model,name:survey_answer_generation.model_survey_user_input_line
msgid "Survey User Input Line"
msgstr ""
3 changes: 3 additions & 0 deletions survey_answer_generation/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from . import survey_question
from . import survey_user_input
from . import survey_survey
27 changes: 27 additions & 0 deletions survey_answer_generation/models/survey_question.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2022 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class SurveyQuestion(models.Model):
_inherit = "survey.question"

next_survey_id = fields.Many2one(related="survey_id.next_survey_id")
next_survey_question_id = fields.Many2one(
comodel_name="survey.question",
domain="[('survey_id', '=', next_survey_id), ('question_type', '=', question_type)]",
help="Prefill this answer of the next survey with the answer of this one",
)


class SurveyLabel(models.Model):
_inherit = "survey.question.answer"

next_survey_question_id = fields.Many2one(
related="question_id.next_survey_question_id"
)
next_survey_question_answer_id = fields.Many2one(
comodel_name="survey.question.answer",
domain="[('question_id', '=', next_survey_question_id)]",
help="Prefill this answer of the next survey with the answer of this one",
)
11 changes: 11 additions & 0 deletions survey_answer_generation/models/survey_survey.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Copyright 2023 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import fields, models


class SurveySurvey(models.Model):
_inherit = "survey.survey"

next_survey_id = fields.Many2one(
comodel_name="survey.survey", domain="[('id', '!=', id)]"
)
Loading

0 comments on commit 94fd821

Please sign in to comment.