How to set my date default value as 05/08/2022??
Bu soru işaretlendi
1
Cevapla
4238
Görünümler
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?
Tartışma hoşunuza mı gidiyor? Sadece okumakla kalmayın, katılın!
Özel özelliklerden yararlanmak ve harika topluluğumuzla etkileşime geçmek için bugün bir hesap oluşturun!
Üye Ol| İlgili Gönderiler | Cevaplar | Görünümler | Aktivite | |
|---|---|---|---|---|
|
|
0
Mar 26
|
16 | ||
|
Timesheet App in backoffice
Çözüldü
|
|
2
Mar 26
|
3907 | |
|
|
2
Eki 25
|
5577 | ||
|
|
1
Eyl 25
|
5102 | ||
|
|
3
Tem 25
|
6145 |