How to set my date default value as 05/08/2022??
Cette question a été signalée
1
Répondre
4259
Vues
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?
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrire| Publications associées | Réponses | Vues | Activité | |
|---|---|---|---|---|
|
|
0
mars 26
|
16 | ||
|
Timesheet App in backoffice
Résolu
|
|
2
mars 26
|
3929 | |
|
|
2
oct. 25
|
5589 | ||
|
|
1
sept. 25
|
5114 | ||
|
|
3
juil. 25
|
6148 |