Skip to content

Instantly share code, notes, and snippets.

@aannganyelne
Created September 27, 2022 20:36
Show Gist options
  • Save aannganyelne/6f8a922b17fb112aad1f3f0ee9f24cba to your computer and use it in GitHub Desktop.
Save aannganyelne/6f8a922b17fb112aad1f3f0ee9f24cba to your computer and use it in GitHub Desktop.
Odoo 12 Add Timezone Field
...
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