How to set my date default value as 05/08/2022??
La domanda è stata contrassegnata
1
Rispondi
4271
Visualizzazioni
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?
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!
Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!
Registrati| Post correlati | Risposte | Visualizzazioni | Attività | |
|---|---|---|---|---|
|
|
0
mar 26
|
16 | ||
|
Timesheet App in backoffice
Risolto
|
|
2
mar 26
|
3992 | |
|
|
2
ott 25
|
5639 | ||
|
|
1
set 25
|
5162 | ||
|
|
3
lug 25
|
6163 |