diff options
| author | Yannick Tivisse <yti@odoo.com> | 2018-11-07 16:15:21 +0000 |
|---|---|---|
| committer | Yannick Tivisse <yti@odoo.com> | 2018-11-07 16:30:29 +0000 |
| commit | 1c391c3dfbdf733304fc882b9045d25e20e6dd1f (patch) | |
| tree | f222ebc331f142930f4f23aa3384dd7f7adb196d /addons/web/static/src/js/fields/basic_fields.js | |
| parent | 32051efdc99172931cfffe7b621d01b6d8ec8b3d (diff) | |
[FIX] hr_holidays: Correctly compute number_of_days on form loading
On a hr.leave creation on the form view, the fields request_date_from and
request_date_to are set on today. The fields date_from and date_to are set on
now.
We have 2 onchange methods:
- _onchange_request_parameters: Set date_from and date_to according
to the leave configuration.
- _onchange_leave_dates: Set number_of_days according to date_from
and date_to
As _onchange_leave_dates is called before _onchange_request_parameters,
the field number_of_day is always set to 0, even if the leave is taken
for all the day (the default value).
It means that if you don't modify the dates, the value stored in the
database is incorrect.
We have to call manually the method _onchange_leave_dates at the end
of the method _onchange_request_parameters execution to ensure
the validity of the value.
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions
