Tuesday, July 2, 2024
2 changes · saas-17.1
Resolved issues and error corrections
Fixed an issue where creating resource time off through Appointments could force the end date to match the start date, ignoring the user's selected range. The update preserves valid end dates and handles time zones correctly, reducing scheduling errors and validation problems.
Original PR description
Versions -------- - saas-17.1+ Steps ----- 1. Have Appointments installed; 2. go to Appointments / Configuration / Resource Leaves; 3. create a new Resource Time Off; 4. use the daterange widget to…
Versions -------- - saas-17.1+ Steps ----- 1. Have Appointments installed; 2. go to Appointments / Configuration / Resource Leaves; 3. create a new Resource Time Off; 4. use the daterange widget to select a start & end date. Issue ----- No matter which end date you select, it will be on the same day as the start date. Cause ----- Commit bc2ea5fb6d12dc3e6c09c36c7bdc48276fb7960a modified the `resource_calendar_leave_form` to use the `daterange` widget for the `date_from` & `date_to` fields. As a consequence, selecting any `date_from` value triggers the `_compute_date_to` method, overriding the `date_to` field selected by the datepicker. Solution -------- If the leave has a `date_to` value, and it is valid (i.e. not earlier than `date_from`), don't recompute the value. Also fixed an issue computing the `date_to` field by actually converting the `date_from` value to the user's tz: - `user_tz.localize(date_from)` only adds `tzinfo`, it doesn't change the values from UTC. - As a consequence, if `date_from` is '2024-05-01 23:00:00' with user tz Europe/Brussels, the compute method will set hh:mm:ss of `date_to` to '23:59:59', then convert it to UTC, so '21:59:59', which is before `date_from`, causing to a validation error. - Instead, '2024-05-01 23:00:00' should first get converted to local time '2024-05-02 01:00:00', so that `date_to` gets set correctly to '2024-05-02 21:59:59' UTC. opw-3910990
This update refreshes Odoo's spreadsheet component with several fixes that improve day-to-day reliability. It improves Excel file compatibility, prevents accidental sheet movement while renaming, and ensures translations load correctly for users.
Original PR description
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/ec4c09bca [REL] 17.1.21 Task: 0 https://github.com/odoo/o-spreadsheet/commit/7bcb0ae52 [FIX] XLSX: Update the list of…
### Contains the following commits: https://github.com/odoo/o-spreadsheet/commit/ec4c09bca [REL] 17.1.21 Task: 0 https://github.com/odoo/o-spreadsheet/commit/7bcb0ae52 [FIX] XLSX: Update the list of 'future' functions of Excel Task: 4017114 https://github.com/odoo/o-spreadsheet/commit/d15aaf32c [REL] 17.1.20 Task: 0 https://github.com/odoo/o-spreadsheet/commit/195f429bf [FIX] BottomBarSheet: Prevent drag of sheet while editing its name Task: 4010842 https://github.com/odoo/o-spreadsheet/commit/58b8571d4 [FIX] model: mark default translations as loaded Task: 3999116 https://github.com/odoo/o-spreadsheet/commit/74977c768 [IMP] documentation: improve commands documentation Task: 3989757 Co-authored-by: Anthony Hendrickx (anhe) <anhe@odoo.com> Co-authored-by: Alexis Lacroix (laa) <laa@odoo.com> Co-authored-by: Lucas Lefèvre (lul) <lul@odoo.com> Co-authored-by: Dhrutik Patel (dhrp) <dhrp@odoo.com> Co-authored-by: Adrien Minne (adrm) <adrm@odoo.com> Co-authored-by: Mehdi Rachico (mera) <mera@odoo.com> Co-authored-by: Rémi Rahir (rar) <rar@odoo.com> Co-authored-by: Pierre Rousseau (pro) <pro@odoo.com> Co-authored-by: Vincent Schippefilt (vsc) <vsc@odoo.com>