i need Time Zone Field into my Custom Form how i can take this field into my model and show into my form
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
3129
Views
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')
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]