changeset 0934bbcc37b5 in sao:default
details: https://hg.tryton.org/sao?cmd=changeset;node=0934bbcc37b5
description:
        Reload tab even if model is different

        The model of the wizard can be a children of the main model. So we must 
compare
        against the model of the menu and always fall-back to the current tab 
screen.

        issue8837
        review276371003
diffstat:

 src/wizard.js |  17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diffs (28 lines):

diff -r 2aef1292a4f8 -r 0934bbcc37b5 src/wizard.js
--- a/src/wizard.js     Sat Nov 30 22:39:09 2019 +0100
+++ b/src/wizard.js     Sat Nov 30 22:44:57 2019 +0100
@@ -292,18 +292,13 @@
                 var screen;
                 if (!dialog) {
                     dialog = Sao.Tab.tabs.get_current();
-                    if (dialog) {
-                        if (dialog.screen &&
-                               dialog.screen.model_name != this.model) {
-                            is_menu = true;
-                            screen = Sao.main_menu_screen;
-                        }
-                    } else {
-                        is_menu = true;
-                        screen = Sao.main_menu_screen;
-                    }
                 }
-                if (dialog && dialog.screen) {
+                if (!dialog ||
+                    !this.model ||
+                    (Sao.main_menu_screen.model_name == this.model)) {
+                    is_menu = true;
+                    screen = Sao.main_menu_screen;
+                } else {
                     screen = dialog.screen;
                 }
                 if (screen) {

Reply via email to