Add new issue issue12072.

Task #121874
This commit is contained in:
Juanjo Garcia 2023-02-09 09:45:08 +01:00
parent e5234e8167
commit 77dbc03dbb
2 changed files with 89 additions and 0 deletions

87
issue12072.diff Normal file
View file

@ -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) {

2
series
View file

@ -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)