summaryrefslogtreecommitdiff
path: root/addons/web/static/tests/views/basic_model_tests.js
diff options
context:
space:
mode:
authorGéry Debongnie <ged@odoo.com>2017-05-24 16:55:42 +0200
committerGéry Debongnie <ged@odoo.com>2017-05-24 17:26:39 +0200
commit0c28dbf969233990eab01c52abd3f214cc299071 (patch)
tree42da2d1d917541aac7bb718e59ed0d90ebc5c1df /addons/web/static/tests/views/basic_model_tests.js
parent737a2618b5343018134ee7ef4e4df1d5ed35f56f (diff)
[FIX] web: ActionManager: protect set/get scrolltop methods
Here is what could happen before this commit: open a record (let's say project.task) in form view. Then, on the sidebar (actions), choose Merge Selected Tasks), choose a task, and click on Merge. What happens next is a traceback. Here is a more precise description of what happened: - the formview dialog for the merge action closes, which triggers a reload for the main formview - the merge action returned an action description for an act_window - the action manager instantiated a new viewmanager and prepare the form view, which is an async operation (need to load some data to display the form) - the previous view manager (initial one) completes its reload, which makes it rerender the view, which triggers a DOM_updated event - the new view manager see this event, and tries to call getScrollTop on the current view controller, but there are no controller yet, it is not ready. We could argue that some of these events should not happen (for example, if we will open a new view manager action, why do we reload the current view manager?). But solving these issues is a more deep architectural problem (we probably will rewrite the actionmanager/view manager layer at some point). It could also be argued that in any case, the method getScrollTop should not crash (same for setScrollTop). Sadly, these methods are fragile, because some changes in the loading behaviour of a view may break them. So, in any case, protecting them against unexpected traceback is a worthwile investment.
Diffstat (limited to 'addons/web/static/tests/views/basic_model_tests.js')
0 files changed, 0 insertions, 0 deletions