diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 3e5d3860a48..58067c5e4d1 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -284,7 +284,7 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM var shown = this.has_been_loaded; if (options.reload !== false || !this.datarecord.id) { shown = shown.then(function() { - if (self.dataset.index === null) { + if (self.dataset.index === null || !self.datarecord.id) { // null index means we should start a new record return self.on_button_new(); } diff --git a/addons/web/static/test/list-editable.js b/addons/web/static/test/list-editable.js index a91d5012123..3032ae7e5f0 100644 --- a/addons/web/static/test/list-editable.js +++ b/addons/web/static/test/list-editable.js @@ -9,6 +9,9 @@ openerp.testing.section('editor', { mock('test.model:onchange', function () { return {}; }); + mock('test.model:default_get', function () { + return {}; + }); } }, function (test) { /** @@ -211,7 +214,7 @@ openerp.testing.section('list.edition', { }); } }, function (test) { - test('newrecord', {asserts: 6}, function (instance, $fix, mock) { + test('newrecord', {asserts: 7}, function (instance, $fix, mock) { var got_defaults = false; mock('demo:default_get', function (args) { var fields = args[0];