odoo/odoo#193007
Created by Bugfix, Sarah Bellefroid (sbel)
- label
- odoo-dev:17.0-opw-4352543-list_page_refreshes-sbel
- head
- 0afa56ed8b56c2d1f69273e91e2b8e9e7f12dbc2
odoo/odoo | |
---|---|
17.0 | #193007 |
[FIX] survey: create question at the end of survey
Currently when a survey has more than 1 page of questions, creating questions from the last page, last line, will add the question at the correct page but all other questions created further from the 'same' wizard will be added at the end of page 1 (beginning of page 2).
Steps to reproduce:
- Open any survey and duplicate any question to have more than 50 questions.
- Navigate to the second page
- Select "Add a question"
- Add a title and seleect Save & new (repeat a couple times)
- Close the wizard
> Observation: The first question is added at the end of the survey. The
rest is added at the beginning of page 2
Why the fix:
Since this commit was introduced b1d185624599b9e4a5457399a99525a04de9d9bb the survey is saved each time a question is added. Globally speaking, when a form containing a list is saved, the list is refreshed back to page 1.
In our case, when we select 'Add a question', the list in the background is on page 2 and the last line will be used for the sequence of the new question. When selecting save & New, we can see in the background that the list is refreshed back to page 1 and the last line of page 1 will now be used for the sequence. So technically the questions are added at the end of page 1, and because page 1 is already full, they show at the beginning of page 2.
Now we systematically add the questions at the end of the survey by loading the last page of the list renderer after each save.