From 61aeb845d2b0509dffc0d7bb6689f973f0c341bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Fri, 9 Oct 2015 12:42:37 +0200 Subject: [PATCH] Calling written should be done after the save to get the right id if it is a creation --- src/model.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/model.js b/src/model.js index 017f72f669..33c2e9b3c6 100644 --- a/src/model.js +++ b/src/model.js @@ -444,14 +444,16 @@ context); } } - prm.done(function() { + prm = prm.done(function() { this.cancel(); if (force_reload) { return this.reload(); } }.bind(this)); if (this.group) { - this.group.written(this.id); + prm = prm.done(function() { + return this.group.written(this.id); + }.bind(this)); } if (this.group.parent) { delete this.group.parent._changed[this.group.child_name];