Use cancel_record instead of removing from group

cancel_record uses Screen.remove which ensure the cursor is correctly set after
the removal.
This also ensure that cancel_record remove only the current record.

issue5852
review29641002
This commit is contained in:
Cédric Krier committed 2016-10-25 23:14:20 +02:00
1 parent d950a96805
commit 970c92abfc
2 files changed
+5 -10

No files matched your search

+1 -1
View File
@@ -358,7 +358,7 @@
this.screen.current_record) {
result = false;
if ((this.screen.current_record.id < 0) || this.save_current) {
this.screen.group.remove(this.screen.current_record, true);
this.screen.cancel_current();
} else if (this.screen.current_record.has_changed()) {
this.screen.current_record.cancel();
this.screen.current_record.reload().always(function() {