To recreate I have a single Datetime field and a simple form view for it.
I've changed all of my Odoo users timezone to Japan (UTC+9) for test (settings/users/manage users), even the users marked as inactive. However when a user logs in and goes to that form and edits datetime field the field takes system OS timezone (UTC+2) in question and ignores user timezone in settings.
I've tested this - if user enters for example 2021-06-13 13:12:46 it is saved in database as 2021-06-13 11:12:46 which is correct for timezone UTC+2 , however since user has Japan set as their timezone in the settings I expected that to be saved as 2021-06-13 04:12:46 in the database.
Is this expected behaviour? Is it ALWAYS going to be like this (is there any case where it will take user timezone into the account?). For what is the user timezone even used?
Also can I somehow take this information from the env? Same as I get user timezone:
self.env.user.tz
but for system timezone? Or do I have to get it myself with Python? Edit: Actually I can't do it with Python for users, I can only get server system timezone not the user system timezone. How do I deal with this?
I''m using Odoo 14 and Ubuntu 20
Edit: I can't comment on your answers because I lack 8 karma, whoever thought of this is...
anyway for my question I think I have to rely on users setting their timezone in settings to match their system timezone? Aka I hope they don't screw around(since they can easily select wrong one)?