diff options
| author | Lucas Perais (lpe) <lpe@odoo.com> | 2018-11-16 13:25:24 +0000 |
|---|---|---|
| committer | Lucas Perais (lpe) <lpe@odoo.com> | 2018-11-19 15:38:22 +0000 |
| commit | 596af12c21ae1df4679bfc526c6724e9b5453e0b (patch) | |
| tree | 3c342b5f781980bb542ecd99d0f8b4c6c77cc65f /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 5eb2fbdec3e58c6b545cd7e96dc9a24adcd12b84 (diff) | |
[FIX] web: dateField datepicker don't propagate field options
In a form view (account.invoice), have a date field as:
<field name="date" options="{\'datepicker\': {\'warn_future\': true}}"/>
Open a record with the field set to a value
Click Edit, click save
Click create
Before this commit, the value of the field of the new record
took the one of the previous record
On account invoices, it resulted on having the popup "The record has been modified etc...."
And it was not possible to create an invoice from another one
this was because we passed the same reference object for the datepicker
After this commit, there is no popup as the field do not take a value from the framework
OPW 1906085
closes odoo/odoo#28759
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
| -rw-r--r-- | addons/web/static/src/js/fields/basic_fields.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js index b324d6f2efa..53fbf99a8cd 100644 --- a/addons/web/static/src/js/fields/basic_fields.js +++ b/addons/web/static/src/js/fields/basic_fields.js @@ -501,6 +501,7 @@ var FieldDate = InputField.extend({ // use the session timezone when formatting dates this.formatOptions.timezone = true; this.datepickerOptions = _.defaults( + {}, this.nodeOptions.datepicker || {}, {defaultDate: this.value} ); |
