Created
September 27, 2022 20:36
-
-
Save aannganyelne/6f8a922b17fb112aad1f3f0ee9f24cba to your computer and use it in GitHub Desktop.
Odoo 12 Add Timezone Field
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
date_tz = fields.Selection('_tz_get', string='Timezone', required=True, | |
default=lambda self: self.env.user.tz or 'UTC') | |
@api.model | |
def _tz_get(self): | |
return [(x, x) for x in pytz.all_timezones] | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment