How to set my date default value as 05/08/2022??
Această întrebare a fost marcată
1
Răspunde
4255
Vizualizări
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?
Îți place discuția? Nu doar citi, alătură-te!
Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!
Înscrie-te| Postări similare | Răspunsuri | Vizualizări | Activitate | |
|---|---|---|---|---|
|
|
0
mar. 26
|
16 | ||
|
Timesheet App in backoffice
Rezolvat
|
|
2
mar. 26
|
3922 | |
|
|
2
oct. 25
|
5586 | ||
|
|
1
sept. 25
|
5108 | ||
|
|
3
iul. 25
|
6147 |