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

survey_question_type_binary reestructured #132

Open
adasatorres opened this issue Oct 18, 2024 · 3 comments
Open

survey_question_type_binary reestructured #132

adasatorres opened this issue Oct 18, 2024 · 3 comments

Comments

@adasatorres
Copy link

Good morning, while I was developing a functionality for the survey module, I noticed that the survey_question_type_binary add-on does not follow the same logic as the other standard Odoo questions, which complicates certain developments. I suggest restructuring the add-on to standardize the code and avoid future issues with other add-ons.

My suggestion would be in the survey_form.js file. I don't think the _submitForm method should be overridden, but rather the _prepareSubmitValues method should be.

Have a great day!

@pedrobaeza
Copy link
Member

Yes, I agree

mando-way-this-is-the-way-289831086

@adasatorres
Copy link
Author

Good morning, the change I suggested has encountered a problem. The FileReader used to read the file's content is asynchronous, so all the previous methods should be asynchronous as well, including the _submitForm() method. Otherwise, the call to the controller will execute before the file information is obtained. I've noticed that in versions after 16, Odoo has already made this method asynchronous to avoid passing the promise to the nextScreen() method. However, they left the _prepareSubmitValues() method unchanged, I assume because the standard fields of the survey module don't use any asynchronous methods. Any suggestions?

@pedrobaeza
Copy link
Member

Sorry, no clue. Maybe @chienandalu or @CarlosRoca13 can give you any hint.

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

No branches or pull requests

2 participants