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

[16.0] [MIG] survey_formio #117

Open
wants to merge 9 commits into
base: 16.0
Choose a base branch
from

Conversation

ThomasBinsfeld
Copy link

jdoutreloux and others added 8 commits March 8, 2024 09:12
This module adds the necessary function to generate a form.io compatible
JSON that represents an odoo survey.
It also adds the function that creates or updates a survey_user_input
when given the JSON returned by form.io
The dictionnary with the answer for a multiple choice question should
only contain true answers.
Currently translated at 100.0% (2 of 2 strings)

Translation: survey-13.0/survey-13.0-survey_formio
Translate-URL: https://translation.odoo-community.org/projects/survey-13-0/survey-13-0-survey_formio/it/
for answer in multiple_choice_answers_dict.keys():
answers_dict[question_id + "_" + answer[1:]] = answer[1:]
return answers_dict
return [value for value in multiple_choice_answers_dict.values() if value]

Choose a reason for hiding this comment

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

I've tested this and it seems there's an issue here.
Saving a multiple choice answer given by formio doesn't work. I think Odoo is waiting for the id of the answer, not its value (see : https://github.com/odoo/odoo/blob/16.0/addons/survey/tests/test_survey_ui_session.py#L210 )
I think this should be
return [value for value in multiple_choice_answers_dict.keys() if value] or something like that

Copy link
Author

Choose a reason for hiding this comment

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

Should be better now

Choose a reason for hiding this comment

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

It works now. Thanks :)

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review!

Copy link
Member

@FrancoMaxime FrancoMaxime left a comment

Choose a reason for hiding this comment

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

LGTM: code review

@OCA-git-bot
Copy link
Contributor

This PR has the approved label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants