Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][ADD] survey_answer_generation: New module #92

Open
wants to merge 1 commit into
base: 15.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)
109 changes: 109 additions & 0 deletions survey_answer_generation/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
========================
Survey answer generation
========================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:e3891e6009936fd7316e124a0a604a392fad78a3124ef1d8191594de096bf41f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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.

#. Go to the *Answers* tab choose the linked question.
#. For simple/multiple choice qustions you'll have to link the answers as well.

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.

If the user changes any response in the next question, we can tell the difference in
the backend: go to the participation and in the answers tree let the column
*Diff with origin* show.

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",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's more than just pre-generate

Suggested change
"summary": "Pre-generate answers from another survey",
"summary": "Link and compare 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",
)
Loading
Loading