diff options
| author | Christophe Simonis <chs@odoo.com> | 2018-09-19 09:12:38 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2018-09-19 09:12:38 +0000 |
| commit | 77849703a13361e0acc7fac81fe69ab83bf8898a (patch) | |
| tree | d208fa140d9be5c5eb73e8ffe34c913ad5593e29 /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 3117afbb7e4a4a762ff041f7797250d3b3bd9a05 (diff) | |
| parent | 197119a37d19bf89f0c909f8efcfecdf6f7e17b5 (diff) | |
[MERGE] forward port branch saas-11.5 up to 197119a37d1
closes odoo/odoo#27088
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index d3ca9a653fd..08b6d47f0f5 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -526,6 +526,25 @@ var FieldDate = InputField.extend({ }, //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * Asks the datepicker widget to activate the input, instead of doing it + * ourself, such that 'input' events triggered by the lib are correctly + * intercepted, and don't produce unwanted 'field_changed' events. + * + * @override + */ + activate: function () { + if (this.datewidget) { + this.datewidget.focus(); + return true; + } + return false; + }, + + //-------------------------------------------------------------------------- // Private //-------------------------------------------------------------------------- @@ -2395,7 +2414,7 @@ var JournalDashboardGraph = AbstractField.extend({ return this._super.apply(this, arguments); }, destroy: function () { - if ('nv' in window) { + if ('nv' in window && nv.utils && nv.utils.offWindowResize) { // if the widget is destroyed before the lazy loaded libs (nv) are // actually loaded (i.e. after the widget has actually started), // nv is undefined, but the handler isn't bound yet anyway |
