[Revert] cb30783aba642627c6bf71d4aa812de00e7d536d & 6349048ba0e5e74c74e783ffce8c3c008...
authorDenis Ledoux <dle@odoo.com>
Fri, 3 Oct 2014 12:02:25 +0000 (14:02 +0200)
committerDenis Ledoux <dle@odoo.com>
Fri, 3 Oct 2014 12:03:12 +0000 (14:03 +0200)
[FIX] web: avoid force_reload in list editable
[FIX] web: force load record after reload page

These fixes prevent to open existing record form

addons/web/static/src/js/view_form.js
addons/web/static/test/list-editable.js

index 58067c5..ee15592 100644 (file)
@@ -282,9 +282,9 @@ instance.web.FormView = instance.web.View.extend(instance.web.form.FieldManagerM
         this.$el.add(this.$buttons).removeClass('oe_form_dirty');
 
         var shown = this.has_been_loaded;
-        if (options.reload !== false || !this.datarecord.id) {
+        if (options.reload !== false) {
             shown = shown.then(function() {
-                if (self.dataset.index === null || !self.datarecord.id) {
+                if (self.dataset.index === null) {
                     // null index means we should start a new record
                     return self.on_button_new();
                 }
index 3032ae7..a91d501 100644 (file)
@@ -9,9 +9,6 @@ openerp.testing.section('editor', {
         mock('test.model:onchange', function () {
             return {};
         });
-        mock('test.model:default_get', function () {
-            return {};
-        });
     }
 }, function (test) {
     /**
@@ -214,7 +211,7 @@ openerp.testing.section('list.edition', {
         });
     }
 }, function (test) {
-    test('newrecord', {asserts: 7}, function (instance, $fix, mock) {
+    test('newrecord', {asserts: 6}, function (instance, $fix, mock) {
         var got_defaults = false;
         mock('demo:default_get', function (args) {
             var fields = args[0];