From 920df597d3d7174723736a395e94dc8ff413c70b Mon Sep 17 00:00:00 2001 From: Christophe Matthieu Date: Wed, 29 Mar 2017 17:25:18 +0200 Subject: [REF] barcode, *: update code to new JS framework With the new views, the barcode mechanisms were completely broken, because the view and widget JS code was totally changed. This commit update and refactor all that code to make it work with the new design philosophy. Also, it update the coding style. --- addons/web/static/src/js/views/basic/basic_model.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index f59cf96a881..ced26fb7cb2 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1052,7 +1052,13 @@ var BasicModel = AbstractModel.extend({ defs.push(def); break; case 'CREATE': - defs.push(this.addDefaultRecord(list.id)); + if (command.data) { + defs.push(this.addDefaultRecord(list.id).then(function (id) { + return this.notifyChanges(id, command.data); + })); + } else { + defs.push(this.addDefaultRecord(list.id)); + } break; case 'UPDATE': defs.push(this._applyChange(command.id, command.data)); -- cgit v1.2.3