How to set my date default value as 05/08/2022??
คำถามนี้ถูกตั้งค่าสถานะ
1
ตอบกลับ
4246
มุมมอง
You can do it as below:
my_date = fields.Date(string='My Date', default=lambda self: fields.Date.context_today(self).replace(day=8,month=5,year=2022))
It's working, where we can define the specific date format like DD/MM/YYYY
You can change it from Languages, Enable developer mode then Go to Settings -> Translations -> Languages -> open your language and edit the date format field to %d/%m/%Y
I tried the same but date showing 2022-05-08
You need to refresh the page. Which screen you check it?
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
0
มี.ค. 26
|
16 | ||
|
Timesheet App in backoffice
แก้ไขแล้ว
|
|
2
มี.ค. 26
|
3908 | |
|
|
2
ต.ค. 25
|
5578 | ||
|
|
1
ก.ย. 25
|
5102 | ||
|
|
3
ก.ค. 25
|
6146 |