From c5579ef89e2a595893d0959bef6fddfdbfb6d697 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Thu, 27 Apr 2017 16:44:03 +0200 Subject: [FIX] web: FormRenderer: notebook and invisible pages When switching between records, the active tab of the previous record is made active on the new record. However, before this rev., this was done without checking that this tab is still visible on the new record (there may be an invisible attrs that makes it invisible), so it happened that the active tab was actually invisible. This was for instance the case when switching between stock pickings, as the first tab ('Operations') is sometimes hidden. --- addons/web/static/src/js/views/form/form_renderer.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'addons/web/static/src') diff --git a/addons/web/static/src/js/views/form/form_renderer.js b/addons/web/static/src/js/views/form/form_renderer.js index b0277abce70..1e40ce13dd6 100644 --- a/addons/web/static/src/js/views/form/form_renderer.js +++ b/addons/web/static/src/js/views/form/form_renderer.js @@ -111,9 +111,10 @@ var FormRenderer = BasicRenderer.extend({ var $notebook = $(this); var name = $notebook.data('name'); if (name in state) { - $notebook.find('> ul > li > a[data-toggle="tab"]') - .eq(state[name]) - .click(); + var $page = $notebook.find('> ul > li').eq(state[name]); + if (!$page.hasClass('o_form_invisible')) { + $page.find('a[data-toggle="tab"]').click(); + } } }); }, -- cgit v1.2.3