odoo/odoo — pull request #2680 by digitalsatori (2014-09-24 15:50:28+00:00)
Title: added last display direction in user input

I think issue #2658 is valid, only my proposed patch sucks.
You can reproduce the error by following the following step:
1. answer a survey till the last page,
2. click the 'Previous' button to the page before the last page, and leave that survey
3. go back, answer the survey again, you will see server error

I create an example in the below instance, you can log in and click answer the only interview request, you will see the error
http://18594-8-0-e6790b.runbot6.odoo.com/

The problem occurred because when we are at the last page of the survey and click previous button, the `last_displayed_page` in `user_input` store the very last page ;and when we come back to that survey again, Odoo will try to display the next page of the `last_displayed_page` which is the last page, and thus the None returned and passed to the render.

The proposed solution here will store the last page direction in user_input. Instead of always showing next page (forward direction) of `last_displayed_page`, the new solution will consider the actual 'last direction'