From 0ca137f3e78d78b7d3b13f37b5cb0bfc6de8d343 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 9 Jul 2014 00:30:23 +0200 Subject: [PATCH] Screen doesn't have parent, it is Group review13371004 --- src/screen.js | 15 +++++++-------- src/view.js | 4 ++-- src/window.js | 2 +- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/screen.js b/src/screen.js index fae5ee3725..529dc4f3f8 100644 --- a/src/screen.js +++ b/src/screen.js @@ -150,7 +150,6 @@ this.search_count = 0; this.screen_container = new Sao.ScreenContainer( attributes.tab_domain); - this.parent = null; if (!attributes.row_activate) { this.row_activate = this.default_row_activate; } else { @@ -241,7 +240,7 @@ search_filter: function(search_string) { var domain = []; - if (this.domain_parser && !this.parent) { + if (this.domain_parser && !this.group.parent) { if (search_string || search_string === '') { domain = this.domain_parser.parse(search_string); } else { @@ -686,8 +685,8 @@ if (written) { this.group.written(ids); } - if (this.parent) { - this.parent.root_parent().reload(); + if (this.group.parent) { + this.group.parent.root_parent().reload(); } this.display(); }, @@ -747,10 +746,10 @@ } } else if (action == 'delete') { if (access['delete']) { - this.remove(!this.parent, false, !this.parent); + this.remove(!this.group.parent, false, !this.group.parent); } } else if (action == 'remove') { - if (access.write && access.read && this.parent) { + if (access.write && access.read && this.group.parent) { this.remove(false, true, false); } } else if (action == 'copy') { @@ -794,7 +793,7 @@ } else if ((view.view_type == 'tree') && (view.children_field)) { var parent_, paths, selected_paths, tree_state_model; - parent_ = this.parent ? this.parent.id : null; + parent_ = this.group.parent ? this.group.parent.id : null; paths = view.get_expanded_paths(); selected_paths = view.get_selected_paths(); if (!(parent_ in this.tree_states)) { @@ -831,7 +830,7 @@ if (!view || (view.view_type != 'tree') || !this.group) { return; } - parent_ = this.parent ? this.parent.id : null; + parent_ = this.group.parent ? this.group.parent.id : null; if (!(parent_ in this.tree_states)) { this.tree_states[parent_] = {}; } diff --git a/src/view.js b/src/view.js index d6e8c214f8..f3fc74f015 100644 --- a/src/view.js +++ b/src/view.js @@ -2769,7 +2769,7 @@ if (field === undefined) { this.screen.new_group(); this.screen.set_current_record(null); - this.screen.parent = true; + this.screen.group.parent = null; this.screen.display(); return; } @@ -2989,7 +2989,7 @@ if (field === undefined) { this.screen.new_group(); this.screen.set_current_record(null); - this.screen.parent = true; + this.screen.group.parent = null; this.screen.display(); return; } diff --git a/src/window.js b/src/window.js index c0f0769c50..caf82b7d6f 100644 --- a/src/window.js +++ b/src/window.js @@ -312,7 +312,7 @@ }); screen.switch_view().done(function() { screen.search_filter(); - screen.parent = record; + screen.group.parent = record; }); Sao.Window.Attachment._super.init.call(this, screen, this.callback, {view_type: 'tree'});