Use stringified field value to compare for change

Decimal uses an instance of Number to be different with Float but instance
comparison doesn't work in javascript, so a JSON string must be used.
This commit is contained in:
Cédric Krier committed 2013-11-18 17:33:18 +01:00
1 parent aef4813e49
commit 4864cb8f67
1 file changed
+3 -1
+3 -1
View File
@@ -927,7 +927,9 @@
set_client: function(record, value, force_change) {
var previous_value = this.get(record);
this.set(record, value);
if (previous_value != this.get(record)) {
// Use stringify to compare object instance like Number for Decimal
if (JSON.stringify(previous_value) !=
JSON.stringify(this.get(record))) {
record._changed[this.name] = true;
this.changed(record).done(function() {
// TODO parent