1dbe4ea0d7f63d299b48edd6e55accb15a3632d2
- Set the OS in a timezone such as the current day is different from the day in UTC (e.g. America/Nome before 10:00 AM or Australia/Melbourne after 3:00 PM) - Open any datepicker - The 'little triangle' indicating the current day is wrongly set (one day before or after) Knowing that Odoo always creates momentjs date and datetime with the `UTC` flag set to `true`, the `bootstrap-datetimepicker` does something which seems inconsistent. First, it retrieves the `viewDate`, and sets it to the beginning of the month and week in: https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L725 In this part, it is important to note that each `startOf` functions called sets the hours/minutes/seconds to zero. It means that the reference time is changed. Then, it iterates on this newly created date, and determines `today` by comparing it to `getMoment()` in: https://github.com/odoo/odoo/blob/1c6c504215f3ef09e6336c92c9d350e87599eaa1/addons/web/static/lib/bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js#L748 However, `getMoment()` returns the current date and time, but with the `UTC` flag set to `false`. Therefore, we compare a UTC datetime on which the reference time has been changed to a non-UTC datetime, which fails to give the appropriate current day. There are two approaches to solve this. The first possibility is to change the way Odoo defines momentjs dates and datetimes, maybe by removing the `UTC` flag at creation. This sounds like a bad idea, since other widgets or views (such as the calendar or the pivot view) make use of them. This is likely to introduce a bunch of new issues with TZ in these views. The second approach is patching the library to fit our use. Although we usually don't do such a thing, this allows to specifically solve this use case, and in particular placing the 'small triangle' at the appropriate date without impacting any other part of the system or the library. It can be easily performed by comparing the dates and the months to make it work. opw-1915251 closes odoo/odoo#30538
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, Purchase Management, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
Then follow the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%