Skip to Content
Menu
This question has been flagged
1 Reply
3295 Views

Image Preview

i need Time Zone Field into my Custom Form how i can take this field into my model and show into my form



Avatar
Discard
Best Answer

Hi, you can use this field


date_tz      = fields.Selection('_tz_get', string='Timezone', required=True,
default=lambda self: self.env.user.tz or 'UTC')
Avatar
Discard
Author

Not working

error is

object has no attribute '_tz_get'

you must add:

import pytz

@api.model

def _tz_get(self):

return [(x, x) for x in pytz.all_timezones]

Related Posts Replies Views Activity
3
Sep 24
9993
2
Feb 24
602
1
Jul 23
1005
2
Jun 23
1395
1
May 23
11458