-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
chienandalu
wants to merge
1
commit into
OCA:15.0
Choose a base branch
from
Tecnativa:15.0-add-survey_answer_generation
base: 15.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
setup/survey_answer_generation/odoo/addons/survey_answer_generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../survey_answer_generation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
], | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
102
survey_answer_generation/i18n/survey_answer_generation.pot
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", | ||
) |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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