diff --git a/addons/web/static/src/js/pyeval.js b/addons/web/static/src/js/pyeval.js index 6ce85f8d4a3..bfef771d156 100644 --- a/addons/web/static/src/js/pyeval.js +++ b/addons/web/static/src/js/pyeval.js @@ -412,7 +412,17 @@ openerp.web.pyeval = function (instance) { py.PY_getAttr(args.time, 'minute'), py.PY_getAttr(args.time, 'second') ]); - }) + }), + toJSON: function () { + return new Date( + this.year, + this.month - 1, + this.day, + this.hour, + this.minute, + this.second, + this.microsecond / 1000); + }, }); datetime.date = py.type('date', null, { __init__: function () {