Store on the screen only the tree states of the current view
Otherwise it is only the tree states of the last view that is restored. Closes #13822 (grafted from 681adf2400138689f3a9a1e2d2b672057e539482) --HG-- branch : 7.0
This commit is contained in:
1 parent
f6e2367dc3
commit
24c57f098c
2 files changed
+14
-8
No files matched your search
+9
-5
@@ -2153,7 +2153,9 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((this.views.length == 1) && this.current_record) {
|
||||
}
|
||||
if ((view === this.current_view) && (view.view_type == 'form')) {
|
||||
if (this.current_record) {
|
||||
if (!(parent_ in this.tree_states)) {
|
||||
this.tree_states[parent_] = {};
|
||||
}
|
||||
@@ -2169,11 +2171,13 @@
|
||||
paths = [];
|
||||
}
|
||||
var selected_paths = view.get_selected_paths();
|
||||
if (!(parent_ in this.tree_states)) {
|
||||
this.tree_states[parent_] = {};
|
||||
if (view === this.current_view) {
|
||||
if (!(parent_ in this.tree_states)) {
|
||||
this.tree_states[parent_] = {};
|
||||
}
|
||||
this.tree_states[parent_][view.children_field || null] = [
|
||||
paths, selected_paths];
|
||||
}
|
||||
this.tree_states[parent_][view.children_field || null] = [
|
||||
paths, selected_paths];
|
||||
if (store && parseInt(view.attributes.tree_state, 10)) {
|
||||
var tree_state_model = new Sao.Model(
|
||||
'ir.ui.view_tree_state');
|
||||
|
||||
@@ -905,7 +905,8 @@ class Screen:
|
||||
for widget in widgets:
|
||||
if hasattr(widget, 'screen'):
|
||||
widget.screen.save_tree_state(store)
|
||||
if len(self.views) == 1 and self.current_record:
|
||||
if view == self.current_view and view.view_type == 'form':
|
||||
if self.current_record:
|
||||
path = self.current_record.id
|
||||
if path < 0:
|
||||
path = -self.current_record.group.index(
|
||||
@@ -919,8 +920,9 @@ class Screen:
|
||||
else:
|
||||
paths = []
|
||||
selected_paths = view.get_selected_paths()
|
||||
self.tree_states[parent][view.children_field] = (
|
||||
paths, selected_paths)
|
||||
if view == self.current_view:
|
||||
self.tree_states[parent][view.children_field] = (
|
||||
paths, selected_paths)
|
||||
if (store
|
||||
and int(view.attributes.get('tree_state', False))
|
||||
and CONFIG['client.save_tree_state']):
|
||||
|
||||
Reference in new issue
Block a user