From 4864cb8f6740ac0481d25a64724efd1c6feb5d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 18 Nov 2013 17:33:18 +0100 Subject: [PATCH] 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. --- src/model.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/model.js b/src/model.js index a917832d7f..fb2c944378 100644 --- a/src/model.js +++ b/src/model.js @@ -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