Odoo Help

0

0
1 答案
0
GiusyG 意大利
2019/8/5 上午10:43

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')
2 注释
Usman 巴基斯坦
2019/8/6 上午2:00

Not working

error is

object has no attribute '_tz_get'

GiusyG 意大利
2019/8/6 上午2:32

you must add:

import pytz

@api.model

def _tz_get(self):

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

提问
Writer
5178
Usman
标签
Keep Informed
2 关注者(s)
About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now