diff --git a/addons/survey/static/src/js/survey_form.js b/addons/survey/static/src/js/survey_form.js index ada2b644d32..661127221c8 100644 --- a/addons/survey/static/src/js/survey_form.js +++ b/addons/survey/static/src/js/survey_form.js @@ -204,9 +204,11 @@ publicWidget.registry.SurveyFormWidget = publicWidget.Widget.extend({ } } } - // Submit Form + // Auto Submit Form var isLastQuestion = this.$('button[value="finish"]').length !== 0; - if (!isLastQuestion && this.options.usersCanGoBack && isQuestionComplete) { + var questionHasComment = $target.closest('.o_survey_form_choice').find('.o_survey_comment').length !== 0 + || $target.hasClass('o_survey_js_form_other_comment'); + if (!isLastQuestion && this.options.usersCanGoBack && isQuestionComplete && !questionHasComment) { this._submitForm({}); } } else { // $target.attr('type') === 'checkbox' diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml index 6a595b581fc..cf76843f186 100644 --- a/addons/survey/views/survey_templates.xml +++ b/addons/survey/views/survey_templates.xml @@ -88,7 +88,7 @@ class="d-flex flex-grow-1 align-items-center" t-att-data-answer-token="answer.access_token" t-att-data-survey-token="survey.access_token" - t-att-data-users-can-go-back="survey.users_can_go_back" + t-att-data-users-can-go-back="survey.users_can_go_back and not answer.is_session_answer" t-att-data-session-in-progress="answer.is_session_answer" t-att-data-is-start-screen="answer.state == 'new'" t-att-data-readonly="survey_form_readonly"