diff options
| author | Christophe Simonis <chs@odoo.com> | 2016-07-05 23:19:50 +0200 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2016-07-05 23:19:50 +0200 |
| commit | 74b51d3d973469c31459236663f0b4dce0f4c4dc (patch) | |
| tree | d7db8dd483fef232f29d8051885b0f84597eb945 /addons/web/static/src/js | |
| parent | c6e7e2d2aacbaf6c3685ae30b45a01ecf5d1a426 (diff) | |
| parent | 489ea4285996662382a31c47bc33c6d7a3e9c80b (diff) | |
[MERGE] forward port of branch 9.0 up to 489ea42
Diffstat (limited to 'addons/web/static/src/js')
| -rw-r--r-- | addons/web/static/src/js/framework/dialog.js | 4 | ||||
| -rw-r--r-- | addons/web/static/src/js/framework/formats.js | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/addons/web/static/src/js/framework/dialog.js b/addons/web/static/src/js/framework/dialog.js index f401cf78591..1a37b8710b5 100644 --- a/addons/web/static/src/js/framework/dialog.js +++ b/addons/web/static/src/js/framework/dialog.js @@ -130,12 +130,12 @@ var Dialog = Widget.extend({ this.$modal.modal('hide'); }, - destroy: function() { + destroy: function(reason) { if (this.isDestroyed()) { return; } - this.trigger("closed"); + this.trigger("closed", reason); this._super(); diff --git a/addons/web/static/src/js/framework/formats.js b/addons/web/static/src/js/framework/formats.js index 52a2fa5b0b0..8a5a8ffedb7 100644 --- a/addons/web/static/src/js/framework/formats.js +++ b/addons/web/static/src/js/framework/formats.js @@ -163,11 +163,17 @@ function parse_value (value, descriptor, value_if_empty) { var datetime = moment(value, [date_pattern + ' ' + time_pattern, date_pattern_wo_zero + ' ' + time_pattern_wo_zero, moment.ISO_8601], true); if (datetime.isValid()) return time.datetime_to_str(datetime.toDate()); + datetime = moment(value, [date_pattern + ' ' + time_pattern, date_pattern_wo_zero + ' ' + time_pattern_wo_zero, moment.ISO_8601]); + if (datetime.isValid()) + return time.datetime_to_str(datetime.toDate()); throw new Error(_.str.sprintf(_t("'%s' is not a correct datetime"), value)); case 'date': var date = moment(value, [date_pattern, date_pattern_wo_zero, moment.ISO_8601], true); if (date.isValid()) return time.date_to_str(date.toDate()); + date = moment(value, [date_pattern, date_pattern_wo_zero, moment.ISO_8601]); + if (date.isValid()) + return time.date_to_str(date.toDate()); throw new Error(_.str.sprintf(_t("'%s' is not a correct date"), value)); case 'time': var _time = moment(value, [time_pattern, time_pattern_wo_zero, moment.ISO_8601], true); |
