From 77dbc03dbb9bce383c1ba861e927c1be53843ca8 Mon Sep 17 00:00:00 2001 From: Juanjo Garcia Date: Thu, 9 Feb 2023 09:45:08 +0100 Subject: [PATCH] Add new issue issue12072. Task #121874 --- issue12072.diff | 87 +++++++++++++++++++++++++++++++++++++++++++++++++ series | 2 ++ 2 files changed, 89 insertions(+) create mode 100644 issue12072.diff diff --git a/issue12072.diff b/issue12072.diff new file mode 100644 index 0000000..89a08a7 --- /dev/null +++ b/issue12072.diff @@ -0,0 +1,87 @@ +diff --git a/tryton/sao/src/view/form.js b/tryton/sao/src/view/form.js +index b615fb7237..b7d72a155b 100644 +--- a/tryton/sao/src/view/form.js ++++ b/tryton/sao/src/view/form.js +@@ -1274,9 +1274,7 @@ function eval_pyson(value){ + window.setTimeout(() => { + var value = this.get_value(); + window.setTimeout(() => { +- if (this.record && +- (this.get_value() == value) && +- this.modified) { ++ if (this.record && (this.get_value() == value)) { + this.view.screen.record_modified(false); + } + }, 300); +@@ -3213,7 +3211,6 @@ function eval_pyson(value){ + row_activate: this.activate.bind(this), + exclude_field: attributes.relation_field || null, + limit: null, +- context: this.view.screen.context, + pre_validate: attributes.pre_validate, + breadcrumb: breadcrumb, + }); +@@ -3787,7 +3784,6 @@ function eval_pyson(value){ + row_activate: this.activate.bind(this), + readonly: true, + limit: null, +- context: this.view.screen.context, + breadcrumb: breadcrumb, + }); + this.screen.windows.push(this); +@@ -3952,16 +3948,12 @@ function eval_pyson(value){ + // Remove the first tree view as mode is form only + view_ids.shift(); + } +- var model = this.attributes.relation; +- var breadcrumb = jQuery.extend([], this.view.screen.breadcrumb); +- breadcrumb.push(this.attributes.string || Sao.common.MODELNAME.get(model)); +- return new Sao.Screen(model, { ++ return new Sao.Screen(this.attributes.relation, { + 'domain': domain, + 'view_ids': view_ids, + 'mode': ['form'], + 'views_preload': this.attributes.views, +- 'context': context, +- 'breadcrumb': breadcrumb, ++ 'context': context + }); + }, + edit: function() { + +diff --git a/tryton/sao/src/model.js b/tryton/sao/src/model.js +index 5d91429c55..d8358fd299 100644 +--- a/tryton/sao/src/model.js ++++ b/tryton/sao/src/model.js +@@ -1523,13 +1523,13 @@ + var previous_value = this.get(record); + this.set(record, value); + if (this._has_changed(previous_value, this.get(record))) { +- record.set_modified(this.name); + this.changed(record); + record.validate(null, true, false, true); ++ record.set_modified(this.name); + } else if (force_change) { +- this.set_modified(); + this.changed(record); + record.validate(null, true, false, true); ++ this.set_modified(); + } + }, + get_client: function(record) { +@@ -2251,13 +2251,13 @@ + previous_ids.sort(), value.sort()); + this._set_value(record, value, false, modified); + if (modified) { +- record.set_modified(this.name); + this.changed(record); + record.validate(null, true, false, true); ++ record.set_modified(this.name); + } else if (force_change) { +- record.set_modified(); + this.changed(record); + record.validate(null, true, false, true); ++ record.set_modified(); + } + }, + get_client: function(record) { diff --git a/series b/series index 58724b1..c066035 100644 --- a/series +++ b/series @@ -40,3 +40,5 @@ issue11582-sao.diff # [sao] Add authentication services issue12018.diff # [commission] Commissions: Incorrect round to Base Amount Field + +issue12072.diff # [sao] On change fields does not fill correctly (SAO)