Hi, this is my code:
In models.py:
%%%something here%%%
my_field = fields.DateTime('MyField')
%%%something here%%%
In views.xml:
%%%something here%%%
<tree>
%%%something here%%%
<field name="my_field" />
%%%something here%%%
</tree>
%%%something here%%%
I just want to hide seconds for my_field in this tree view. I did some research but everything i found was about qweb or python. Is it possible in this context???
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
1
الرد
8687
أدوات العرض
Rolando
datetime.strptime(Date, '%Y-%m-%d %H:%M:%S').strftime('%Y-%m-%d %H:%M')
It will appear date without seconds. (as a string not date time)
Thank You
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
أكتوبر 16
|
3898 | ||
|
1
سبتمبر 15
|
10491 | ||
|
0
أكتوبر 23
|
2849 | ||
|
1
أكتوبر 19
|
2673 | ||
|
2
يوليو 19
|
21747 |
You can change date format according to your needs: http://learnopenerp.blogspot.com/2018/02/python-strftime-datetime-formatting.html