From 596af12c21ae1df4679bfc526c6724e9b5453e0b Mon Sep 17 00:00:00 2001 From: "Lucas Perais (lpe)" Date: Fri, 16 Nov 2018 13:25:24 +0000 Subject: [FIX] web: dateField datepicker don't propagate field options In a form view (account.invoice), have a date field as: 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 --- addons/web/static/src/js/fields/basic_fields.js | 1 + 1 file changed, 1 insertion(+) (limited to 'addons/web/static/src/js/fields/basic_fields.js') 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} ); -- cgit v1.2.3