From 295671c072cd59c5cdd48e812497bd3a5a0b8b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 30 Apr 2018 14:52:21 +0200 Subject: [PATCH] Let domain inversion set resource field value If the tree view of the resource is editable, the Window.Form saves the records before the callback when the current record is no more edited. This fails because resource field is not yet set. issue7394 review49301002 --- src/window.js | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/window.js b/src/window.js index db5e26bd14..07b82af648 100644 --- a/src/window.js +++ b/src/window.js @@ -409,7 +409,6 @@ domain: [['resource', '=', this.resource]], mode: ['tree', 'form'], context: context, - exclude_field: 'resource' }); screen.switch_view().done(function() { screen.search_filter(); @@ -423,10 +422,6 @@ callback: function(result) { var prm = jQuery.when(); if (result) { - var resource = this.screen.group.model.fields.resource; - this.screen.group.forEach(function(record) { - resource.set_client(record, this.resource); - }.bind(this)); prm = this.screen.save_current(); } if (this.attachment_callback) { @@ -444,7 +439,6 @@ domain: [['resource', '=', this.resource]], mode: ['tree', 'form'], context: context, - exclude_field: 'resource' }); screen.switch_view().done(function() { screen.search_filter(); @@ -458,11 +452,9 @@ callback: function(result) { var prm = jQuery.when(); if (result) { - var resource = this.screen.group.model.fields.resource; var unread = this.screen.group.model.fields.unread; this.screen.group.forEach(function(record) { if (record.get_loaded() || record.id < 0) { - resource.set_client(record, this.resource); if (!record._changed.unread) { unread.set_client(record, false); }