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
3295
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]
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
one2one relational field
Solved
|
|
3
Sep 24
|
9993 | |
|
2
Feb 24
|
602 | ||
|
1
Jul 23
|
1005 | ||
|
2
Jun 23
|
1395 | ||
|
1
May 23
|
11458 |