diff options
| author | David Monjoie <dmo@odoo.com> | 2017-07-03 10:46:10 +0200 |
|---|---|---|
| committer | David Monjoie <dmo@odoo.com> | 2017-07-18 15:51:49 +0200 |
| commit | bce3defc8cd2c0c40e40d7b6cfc58159000ded65 (patch) | |
| tree | 294c4de2ec410834416e1c4071e68bed596b8c52 /addons/web/static/src/js/views/basic | |
| parent | e83c3e2678500c9bf2c17b4d23ae9a294ebafaa7 (diff) | |
[FIX] web: fix calendar server values parsing
The record data given to fullCalendar to use in the renderEvent
function was not parsed like it is in basic model for example.
As a result, date(time) fields were string rather than moment
objects, which was triggering the crash that started this commit.
Diffstat (limited to 'addons/web/static/src/js/views/basic')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index c95f829af71..eead1b0aaed 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -87,7 +87,6 @@ var concurrency = require('web.concurrency'); var Context = require('web.Context'); var core = require('web.core'); var Domain = require('web.Domain'); -var fieldUtils = require('web.field_utils'); var session = require('web.session'); var _t = core._t; @@ -2947,30 +2946,6 @@ var BasicModel = AbstractModel.extend({ }); }, /** - * Processes date(time) and selection field values sent by the server. - * Converts data(time) values to moment instances. - * Converts false values of selection fields to 0 if 0 is a valid key, - * because the server doesn't make a distinction between false and 0, and - * always sends false when value is 0. - * - * @param {Object} field the field description - * @param {*} value - * @returns {*} the processed value - */ - _parseServerValue: function (field, value) { - if (field.type === 'date' || field.type === 'datetime') { - // process date(time): convert into a moment instance - value = fieldUtils.parse[field.type](value, field, {isUTC: true}); - } else if (field.type === 'selection' && value === false) { - // process selection: convert false to 0, if 0 is a valid key - var hasKey0 = _.find(field.selection, function (option) { - return option[0] === 0; - }); - value = hasKey0 ? 0 : value; - } - return value; - }, - /** * This method is quite important: it is supposed to perform the /onchange * rpc and apply the result. * |
