<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/survey/controllers/main.py, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] survey: fix the function extract comment from the answers</title>
<updated>2021-03-01T08:16:13+00:00</updated>
<author>
<name>Djamel (otd)</name>
<email>otd@odoo.com</email>
</author>
<published>2021-02-26T10:23:03+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=7064d46a804ab86d1bc50d003b8ae63490a1ef9c'/>
<id>7064d46a804ab86d1bc50d003b8ae63490a1ef9c</id>
<content type='text'>
Steps to follow to reproduce the bug:
	-Go to survey
	-Choose any survey with at least one "single text box" question
	-In the survey form
	-Click on the button test
	-Complete the survey, but in a "single text box" question, write the word "comment"
	-Validate the survey
	-An error is triggered.

Problem :
In the function which extracts comments from answers, it doesn't check the type in which the answer is stored.
When there is a comment, it is stored in a dict under the key: "comment".
To find the comment, the function checks if "comment"(key) is in the answer.
But in the case of "single text box" question, the answer is stored in a string.
If the word "comment" is present in the answer, the function looking for the key "comment" will return True and try to extract the comment.

Solution :
Add a check to ensure that we are looking for the key "comment" in dict type.

opw-2446194

closes odoo/odoo#66907

Signed-off-by: Anh Thao PHAM &lt;kitan191@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to follow to reproduce the bug:
	-Go to survey
	-Choose any survey with at least one "single text box" question
	-In the survey form
	-Click on the button test
	-Complete the survey, but in a "single text box" question, write the word "comment"
	-Validate the survey
	-An error is triggered.

Problem :
In the function which extracts comments from answers, it doesn't check the type in which the answer is stored.
When there is a comment, it is stored in a dict under the key: "comment".
To find the comment, the function checks if "comment"(key) is in the answer.
But in the case of "single text box" question, the answer is stored in a string.
If the word "comment" is present in the answer, the function looking for the key "comment" will return True and try to extract the comment.

Solution :
Add a check to ensure that we are looking for the key "comment" in dict type.

opw-2446194

closes odoo/odoo#66907

Signed-off-by: Anh Thao PHAM &lt;kitan191@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey: no block on return to certification</title>
<updated>2020-12-02T16:59:47+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2020-12-02T14:37:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=4d088ad719b456e73b7586087084a6d0b59ff455'/>
<id>4d088ad719b456e73b7586087084a6d0b59ff455</id>
<content type='text'>
steps to reproduce:

- start a certification with time limit
- close it and go to it back after time limit +10 seconds is passed

=&gt; an "There was an error during the validation of the survey." appear
   that prevent to finish the survey or do it a second time until the
   ongoing survey.user_input of the user is deleted.

This was done to prevent people from cheating by answering after the
time limit end. With this changeset, when we go back to the survey after
its end, we will finish it without saving the answers.

opw-2390623
closes #62752

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Co-authored-by: David Beguin &lt;dbe@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
steps to reproduce:

- start a certification with time limit
- close it and go to it back after time limit +10 seconds is passed

=&gt; an "There was an error during the validation of the survey." appear
   that prevent to finish the survey or do it a second time until the
   ongoing survey.user_input of the user is deleted.

This was done to prevent people from cheating by answering after the
time limit end. With this changeset, when we go back to the survey after
its end, we will finish it without saving the answers.

opw-2390623
closes #62752

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
Co-authored-by: David Beguin &lt;dbe@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey: redirect on login page on survey start if not logged in.</title>
<updated>2020-10-02T09:29:57+00:00</updated>
<author>
<name>David Beguin</name>
<email>dbe@odoo.com</email>
</author>
<published>2020-05-05T07:54:04+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=66e350c24f575b3978654c8f6027482d89de963d'/>
<id>66e350c24f575b3978654c8f6027482d89de963d</id>
<content type='text'>
Before this commit, when sharing a survey 'Login required' to a non logged in
user, the redirection was made to the home page.
The reason is: when the survey is not started yet, no user input is already
created for this survey and this user. So if no user_input has been created,
yet, that means that the user has never started the survey before and user
need first to login before continuing.

After this commit, we redirect to the loggin page.

Task ID: 2246430

closes odoo/odoo#58960

X-original-commit: a309d889ddf6e03a6701e921258cfa9338800fbb
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: David Beguin &lt;dbeguin@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, when sharing a survey 'Login required' to a non logged in
user, the redirection was made to the home page.
The reason is: when the survey is not started yet, no user input is already
created for this survey and this user. So if no user_input has been created,
yet, that means that the user has never started the survey before and user
need first to login before continuing.

After this commit, we redirect to the loggin page.

Task ID: 2246430

closes odoo/odoo#58960

X-original-commit: a309d889ddf6e03a6701e921258cfa9338800fbb
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
Signed-off-by: David Beguin &lt;dbeguin@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey: ensure to retrieve the participant's answer when restarting</title>
<updated>2020-09-28T16:34:09+00:00</updated>
<author>
<name>David Beguin</name>
<email>dbe@odoo.com</email>
</author>
<published>2020-09-24T09:18:11+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=13250dfd0ab140b4e60ec3f30832999a867426fc'/>
<id>13250dfd0ab140b4e60ec3f30832999a867426fc</id>
<content type='text'>
In order to avoid making it possible to follow the same survey multiple times
at the same time, a survey cookie is added with the survey token and answer
token.

When starting the survey, if the cookie contains a valid answer token for that
survey token, the survey session is reloaded where the participant left it.
When the user finished the survey, the cookie is deleted to allow to retake the
survey later, if possible.

Note: A participant can still open multiple tabs with the same survey, but it
will be linked to the same survey answer. So if the user tries to submit another
answer, the late answer will overwrite the previous one.

Task ID: 2345468

closes odoo/odoo#58720

X-original-commit: c97c266313aff864f8c397fb1b42f792f9650e5e
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to avoid making it possible to follow the same survey multiple times
at the same time, a survey cookie is added with the survey token and answer
token.

When starting the survey, if the cookie contains a valid answer token for that
survey token, the survey session is reloaded where the participant left it.
When the user finished the survey, the cookie is deleted to allow to retake the
survey later, if possible.

Note: A participant can still open multiple tabs with the same survey, but it
will be linked to the same survey answer. So if the user tries to submit another
answer, the late answer will overwrite the previous one.

Task ID: 2345468

closes odoo/odoo#58720

X-original-commit: c97c266313aff864f8c397fb1b42f792f9650e5e
Signed-off-by: Thibault Delavallee (tde) &lt;tde@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey: 403 Forbidden when printing survey</title>
<updated>2020-08-06T12:34:14+00:00</updated>
<author>
<name>Goffin Simon</name>
<email>sig@odoo.com</email>
</author>
<published>2020-08-04T13:25:07+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=923c1eae5e27fb63723a80a87808915cb478837d'/>
<id>923c1eae5e27fb63723a80a87808915cb478837d</id>
<content type='text'>
Steps to reproduce the bug:

- Let's consider a survey S
- Set the scoring option of S to Scoring without answers at the end
- print S

Bug:

A 403 error was raised.

opw:2307495

closes odoo/odoo#55556

X-original-commit: bb627bf8c182905adcf2bf9d9820c6e91dd44d26
Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Steps to reproduce the bug:

- Let's consider a survey S
- Set the scoring option of S to Scoring without answers at the end
- print S

Bug:

A 403 error was raised.

opw:2307495

closes odoo/odoo#55556

X-original-commit: bb627bf8c182905adcf2bf9d9820c6e91dd44d26
Signed-off-by: Simon Goffin (sig) &lt;sig@openerp.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] survey: display only answered question in survey review mode</title>
<updated>2020-07-28T08:03:34+00:00</updated>
<author>
<name>David Beguin</name>
<email>dbe@odoo.com</email>
</author>
<published>2020-04-16T12:00:09+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=f0f7f888d39970cc197a9627ebc0dfd1118ea540'/>
<id>f0f7f888d39970cc197a9627ebc0dfd1118ea540</id>
<content type='text'>
Unanswered questions or sections are now hidden in the survey review mode.
Only the question answered by the user will be visible.
If the survey was done during a session, the users will see their own answers,
even if the theme they selected was not the most voted one (in case of
conditional questions).

To get the questions to display :
- questions that have been answered
- + the ones that should have been answered = active questions
  In session, active questions are based on most voted answers)

This commit also fixes the randomized questions handling in most voted answers,
as copied predefined questions where &lt;NewIds&gt; and those was not usable in
some templates.

Task ID: 2230980

X-original-commit: 8ca79727d5a93b91746c1e63d59d08550417906c</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unanswered questions or sections are now hidden in the survey review mode.
Only the question answered by the user will be visible.
If the survey was done during a session, the users will see their own answers,
even if the theme they selected was not the most voted one (in case of
conditional questions).

To get the questions to display :
- questions that have been answered
- + the ones that should have been answered = active questions
  In session, active questions are based on most voted answers)

This commit also fixes the randomized questions handling in most voted answers,
as copied predefined questions where &lt;NewIds&gt; and those was not usable in
some templates.

Task ID: 2230980

X-original-commit: 8ca79727d5a93b91746c1e63d59d08550417906c</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] survey: Extract code to allow inheritance</title>
<updated>2020-06-10T09:03:06+00:00</updated>
<author>
<name>Yannick Tivisse</name>
<email>yti@odoo.com</email>
</author>
<published>2020-06-08T16:00:34+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=0215a52252792abab0f274e227195c8f187b3127'/>
<id>0215a52252792abab0f274e227195c8f187b3127</id>
<content type='text'>
closes odoo/odoo#52636

Taskid: 2186462
Related: odoo/enterprise#10951
Related: odoo/upgrade#1314
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
closes odoo/odoo#52636

Taskid: 2186462
Related: odoo/enterprise#10951
Related: odoo/upgrade#1314
Signed-off-by: Yannick Tivisse (yti) &lt;yti@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] *: convert to private methods</title>
<updated>2020-05-14T11:59:10+00:00</updated>
<author>
<name>Martin Trigaux</name>
<email>mat@odoo.com</email>
</author>
<published>2020-02-14T10:22:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=d9287caf9408bb4ff85ad734cbca08e44321e205'/>
<id>d9287caf9408bb4ff85ad734cbca08e44321e205</id>
<content type='text'>
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] survey: auto submit for questions and matrix with simple choice</title>
<updated>2020-03-31T16:25:53+00:00</updated>
<author>
<name>David Beguin</name>
<email>dbe@odoo.com</email>
</author>
<published>2020-03-04T08:54:15+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=280c6bf1d6d823cde7aae1608aca4e4c36a80f22'/>
<id>280c6bf1d6d823cde7aae1608aca4e4c36a80f22</id>
<content type='text'>
Purpose
=======

Speed up survey completion.

Specifications
==============

This commit apply an auto commit when user select a choice on a simple choice
question or on a matrix question with simple choice.

The auto commit happens following those conditions:
- Only on simple choice and matrix with simple choice questions
- For matrix, only when last subquestion is answered
- Only when Back mode is active
- If this is not the last question

Link
====

PR #46768
Task 2208574</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Purpose
=======

Speed up survey completion.

Specifications
==============

This commit apply an auto commit when user select a choice on a simple choice
question or on a matrix question with simple choice.

The auto commit happens following those conditions:
- Only on simple choice and matrix with simple choice questions
- For matrix, only when last subquestion is answered
- Only when Back mode is active
- If this is not the last question

Link
====

PR #46768
Task 2208574</pre>
</div>
</content>
</entry>
<entry>
<title>[IMP] survey: improve survey form navigation</title>
<updated>2020-03-31T16:25:52+00:00</updated>
<author>
<name>Aurélien Warnon</name>
<email>awa@odoo.com</email>
</author>
<published>2020-03-20T14:28:14+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=176e5a5066ec0248c80d15af60a6be237cb450d0'/>
<id>176e5a5066ec0248c80d15af60a6be237cb450d0</id>
<content type='text'>
This commit slightly changes the way users navigate through the survey form:
- The back button was moved to the bottom-right of the screen.
- The "Continue" button stays at the center but there is also a "next" button
  at the bottom-right of the screen (same behavior -&gt; submits the form)
- Arrow keys (left + right) navigation is now supported

Technical note: As the survey navigation is now outside of the survey content,
that was re-rendered on every submit, we have to manually refresh the
navigation with a second template render on the controller side.

LINKS

PR #46768
Task 2208574</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit slightly changes the way users navigate through the survey form:
- The back button was moved to the bottom-right of the screen.
- The "Continue" button stays at the center but there is also a "next" button
  at the bottom-right of the screen (same behavior -&gt; submits the form)
- Arrow keys (left + right) navigation is now supported

Technical note: As the survey navigation is now outside of the survey content,
that was re-rendered on every submit, we have to manually refresh the
navigation with a second template render on the controller side.

LINKS

PR #46768
Task 2208574</pre>
</div>
</content>
</entry>
</feed>
