Se rendre au contenu
Menu
Cette question a été signalée
1 Répondre
2801 Vues

How to set my date default value as 05/08/2022??

Avatar
Ignorer
Meilleure réponse

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))

Avatar
Ignorer
Auteur

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

Auteur

I tried the same but date showing 2022-05-08

You need to refresh the page. Which screen you check it?

Publications associées Réponses Vues Activité
1
juin 25
1614
3
juil. 25
3258
1
mai 25
1399
1
mai 25
1648
4
mai 25
2816