Wednesday, June 6, 2018
3 changes
Enhancements to existing features
Time off types can now be configured so employees request leave in days, half days, or hours. This gives businesses more control over how different absence policies are managed and makes leave tracking better match company rules.
Original PR description
Task: https://www.odoo.com/web#id=40995&view_type=form&model=project.task&menu_id=
Odoo now handles date and time values more consistently across the system, reducing the need for manual conversions and lowering the risk of timezone-related mistakes. This update improves reliability in accounting and other business workflows where accurate dates and times are important.
Original PR description
Create new classes to return date and datetime-like objects accepting string behaviors. This permits to be compatible with existing code and to manipulate date and datetime without need of manual conversion. Each datetime has an explicit timezone, UTC by default, to fix all issues about misconvertion when timezone is unknown.
Exemples of operations:
```python
record.start_datetime -= datetime.timedelta(days=2)
record.start_datetime.replace('2017', '2018')
record.start_datetime.replace(year=2018)
record.start_datetime - '2015-10-26 16:29:00'
```
New classes are based on [pendulum](https://pendulum.eustace.io/) to have native support of correct timezones and a lot of great features. Date and datetime are automatically converted in good format for JSON exchange. The datetime lib is added to context for safe eval and server actions.
This cleans all modules and converts them to the new behavior.Date and time fields now behave more consistently while still working with existing text-based processes. This reduces timezone-related errors and makes accounting reports, imports, bank syncs, and follow-up workflows more reliable.
Original PR description
Create new classes to return date and datetime-like objects accepting string behaviors. This permits to be compatible with existing code and to manipulate date and datetime without need of manual conversion. Each datetime has an explicit timezone, UTC by default, to fix all issues about misconvertion when timezone is unknown.
Exemples of operations:
record.start_datetime -= datetime.timedelta(days=2)
record.start_datetime.replace('2017', '2018')
record.start_datetime.replace(year=2018)
record.start_datetime - '2015-10-26 16:29:00'
New classes are based on pendulum https://pendulum.eustace.io/ to have native support of correct timezones and a lot of great features. Date and datetime are automatically converted in good format for JSON exchange. The datetime lib is added to context for safe eval and server actions.
This cleans all modules and converts them to the new behavior.