Odoo Help

0

0
1 إجابة
0
GiusyG ايطاليا
5‏/8‏/2019 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 باكستان
6‏/8‏/2019 2:00 ص

Not working

error is

object has no attribute '_tz_get'

GiusyG ايطاليا
6‏/8‏/2019 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 متابعين
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