When a tour fails, the tour system is supposed to log the failing
step (with the 3 previous/next steps). Before this commit, this
didn't work, and the first 3 steps were always logged, no matter
which step failed.
This didn't work because to determine the failing step, we try to
find the step from the list of steps, with reference matching
(steps are objects).
However, since [1], steps are obtained from a getter which calls
the steps function of the tour, so they always get a new version
of the steps.
This commit fixes the issue by memoizing the steps, such that the
function is called only once, and we keep the same references to
the step objects.
Note that this could be reworked in master to make it more robust
(e.g. finding steps based on ids).
[1] https://github.com/odoo/odoo/commit/81be42d8f9421e796087325c99aa4289d3912352closesodoo/odoo#145385
X-original-commit: 16ffd4d0bcb705c86fedd8dc7e6dd749c35eb5bc
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>