From 1ac44a9ee1d48c5259407aea85ecdcbdd1b228de Mon Sep 17 00:00:00 2001 From: Sergi Almacellas Abellana Date: Thu, 24 Nov 2016 16:55:25 +0100 Subject: [PATCH] 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 --- src/screen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/screen.js b/src/screen.js index 38f45bef24..ce82a1185c 100644 --- a/src/screen.js +++ b/src/screen.js @@ -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') {