summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/core
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-09-07 14:43:48 +0200
committerChristophe Simonis <chs@odoo.com>2018-09-07 14:43:48 +0200
commit49c3264ce0f73a746f9a229dba423f6c0ea3d485 (patch)
tree9cd4603a7b9708d061802f9e0f638e5c684d15a9 /addons/web/static/src/js/core
parentb4c72220c72e22328b3a96024c59d79889b71ae5 (diff)
parent4850fb08385de3f0851a732c97c90402e89838b7 (diff)
[MERGE] forward port branch saas-11.3 up to 4850fb08385
Diffstat (limited to 'addons/web/static/src/js/core')
-rw-r--r--addons/web/static/src/js/core/pyeval.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/addons/web/static/src/js/core/pyeval.js b/addons/web/static/src/js/core/pyeval.js
index ee4ac697fd9..810cb7f38bd 100644
--- a/addons/web/static/src/js/core/pyeval.js
+++ b/addons/web/static/src/js/core/pyeval.js
@@ -642,13 +642,15 @@ var relativedelta = py.type('relativedelta', null, {
this._fix();
},
_fix: function () {
+ var self = this;
var months = asJS(this.ops.months);
if (Math.abs(months) > 11) {
var s = months > 0 ? 1 : -1;
- var r = utils.divmod(months * s, 12);
- this.ops.months = py.float.fromJSON(r.mod*s);
- this.ops.years = py.float.fromJSON(
- asJS(this.ops.years) + r.div*s);
+ utils.divmod(months * s, 12, function (years, months) {
+ self.ops.months = py.float.fromJSON(months*s);
+ self.ops.years = py.float.fromJSON(
+ asJS(self.ops.years) + years*s);
+ });
}
this._has_time = 0;
},