Cédric Krier pushed to branch branch/default at Tryton / Tryton
Commits:
a6a3ae56 by Cédric Krier at 2023-02-06T18:09:20+01:00
Set record as modified after calling changed
The record must be modified after the call to changed because set_modified
trigger the changed calls of the parent which need to have the changed values.
Closes #12065, #12072
(backout 6b882007fd6e)
- - - - -
2 changed files:
- sao/src/model.js
- tryton/tryton/gui/window/view_form/model/field.py
Changes:
=====================================
sao/src/model.js
=====================================
@@ -1532,6 +1532,5 @@
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);
@@ -1536,3 +1535,4 @@
this.changed(record);
record.validate(null, true, false, true);
+ record.set_modified(this.name);
} else if (force_change) {
@@ -1538,4 +1538,3 @@
} else if (force_change) {
- record.set_modified();
this.changed(record);
record.validate(null, true, false, true);
@@ -1540,5 +1539,6 @@
this.changed(record);
record.validate(null, true, false, true);
+ record.set_modified();
}
},
get_client: function(record) {
@@ -2299,6 +2299,5 @@
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);
@@ -2303,3 +2302,4 @@
this.changed(record);
record.validate(null, true, false, true);
+ record.set_modified(this.name);
} else if (force_change) {
@@ -2305,4 +2305,3 @@
} else if (force_change) {
- record.set_modified();
this.changed(record);
record.validate(null, true, false, true);
@@ -2307,5 +2306,6 @@
this.changed(record);
record.validate(null, true, false, true);
+ record.set_modified();
}
},
get_client: function(record) {
=====================================
tryton/tryton/gui/window/view_form/model/field.py
=====================================
@@ -162,6 +162,5 @@
previous_value = self.get(record)
self.set(record, value)
if previous_value != self.get(record):
- record.set_modified(self.name)
self.sig_changed(record)
record.validate(softvalidation=True)
@@ -166,3 +165,4 @@
self.sig_changed(record)
record.validate(softvalidation=True)
+ record.set_modified(self.name)
elif force_change:
@@ -168,4 +168,3 @@
elif force_change:
- record.set_modified()
self.sig_changed(record)
record.validate(softvalidation=True)
@@ -170,5 +169,6 @@
self.sig_changed(record)
record.validate(softvalidation=True)
+ record.set_modified()
def get_client(self, record):
return self.get(record)
@@ -763,6 +763,5 @@
modified = set(previous_ids) != set(value)
self._set_value(record, value, modified=modified)
if modified:
- record.set_modified(self.name)
self.sig_changed(record)
record.validate(softvalidation=True)
@@ -767,3 +766,4 @@
self.sig_changed(record)
record.validate(softvalidation=True)
+ record.set_modified(self.name)
elif force_change:
@@ -769,4 +769,3 @@
elif force_change:
- record.set_modified()
self.sig_changed(record)
record.validate(softvalidation=True)
@@ -771,5 +770,6 @@
self.sig_changed(record)
record.validate(softvalidation=True)
+ record.set_modified()
def set_default(self, record, value):
self.set(record, value, _default=True)
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/a6a3ae56d447609c22df77137c76ce0ee90c96bc
--
View it on Heptapod:
https://foss.heptapod.net/tryton/tryton/-/commit/a6a3ae56d447609c22df77137c76ce0ee90c96bc
You're receiving this email because of your account on foss.heptapod.net.