Correctly return record on screen.new

Return a new promise when creating a new record on screen in order
to get the value of the nested promise, otherwise an undefined
value is returned and this breaks the callbacks that manipulate
the returned record.

issue6066
review30811003
This commit is contained in:
Sergi Almacellas Abellana
2016-11-24 16:55:25 +01:00
parent 1092e979ad
commit 1ac44a9ee1
+1 -1
View File
@@ -1074,7 +1074,7 @@
} else {
prm = jQuery.when();
}
return prm.done(function() {
return prm.then(function() {
group.add(record, this.new_model_position());
this.set_current_record(record);
if (previous_view.view_type == 'calendar') {