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
This commit is contained in:
Cédric Krier committed 2018-04-30 14:52:21 +02:00
1 parent 6c827ff95a
commit 295671c072
1 file changed
-8
-8
View File
@@ -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);
}