diff options
| author | Odoo's Mergebot <xmo+roboto@odoo.com> | 2020-07-03 20:50:15 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-03 20:50:15 +0200 |
| commit | 8117907b5390f90da07731592c47eef6ea39395c (patch) | |
| tree | 994397aedf641c8a0524b750bb60ca2c0b0455db /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 88786d6123afdc860db795c9f18cf974421e909d (diff) | |
| parent | c9ba9dc94b7b75711bf65526205adbb2cb6e322a (diff) | |
[FW][FIX] web: unsafe access to config property & extract lib's input setter
During TempusDominus autobinding to fields matching its default classes
(like `.datetimepicker-input` used by our DatePicker widget) and no
config was previously provided to the library (like when we disable it
on mobile), an unsafe access to the config's `_options` property results
into an error as the config is `undefined`.
This PR fixes it by first checking for config existence before
attempting to access its property.
It also extracts the DatePicker widget's input setter to allow
overriding it and preventing from calling the `datetimepicker` lib when
not initialized (like on mobile).
opw-2242880
closes odoo/odoo#54068
Forward-port-of: odoo/odoo#54039
Forward-port-of: odoo/odoo#54005
Related: odoo/enterprise#11654
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions
