Remove Screen.parent hack in Attachment and Note
The modified test in Screen.switch_view can be moved to Screen.default_row_activate only, so the Attachment and Note screen doesn't require to have a fake parent to switch views. issue5558 review23131002
This commit is contained in:
1 parent
de3f83ab23
commit
330319b6bd
2 files changed
+3
-6
No files matched your search
+3
-4
@@ -702,9 +702,6 @@
|
||||
},
|
||||
switch_view: function(view_type) {
|
||||
if (this.current_view) {
|
||||
if (!this.group.parent && this.modified()) {
|
||||
return jQuery.when();
|
||||
}
|
||||
this.current_view.set_value();
|
||||
if (this.current_record &&
|
||||
!~this.current_record.group.indexOf(
|
||||
@@ -960,7 +957,9 @@
|
||||
'ids': [this.get_id()]
|
||||
}, jQuery.extend({}, this.context), false);
|
||||
} else {
|
||||
this.switch_view('form');
|
||||
if (!this.modified()) {
|
||||
this.switch_view('form');
|
||||
}
|
||||
}
|
||||
},
|
||||
get_id: function() {
|
||||
|
||||
@@ -393,7 +393,6 @@
|
||||
});
|
||||
screen.switch_view().done(function() {
|
||||
screen.search_filter();
|
||||
screen.group.parent = record;
|
||||
});
|
||||
Sao.Window.Attachment._super.init.call(this, screen, this.callback,
|
||||
{view_type: 'tree'});
|
||||
@@ -427,7 +426,6 @@
|
||||
});
|
||||
screen.switch_view().done(function() {
|
||||
screen.search_filter();
|
||||
screen.group.parent = record;
|
||||
});
|
||||
Sao.Window.Note._super.init.call(this, screen, this.callback,
|
||||
{view_type: 'tree'});
|
||||
|
||||
Reference in new issue
Block a user