How to set my date default value as 05/08/2022??
Denna fråga har flaggats
1
Besvara
4274
Vyer
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?
Njuter du av diskussionen? Läs inte bara, delta också!
Skapa ett konto idag för att ta del av exklusiva funktioner och engagera dig i vår fantastiska community!
Registrera dig| Relaterade inlägg | Svar | Vyer | Verksamhet | |
|---|---|---|---|---|
|
|
0
mars 26
|
16 | ||
|
|
2
mars 26
|
4033 | ||
|
|
2
okt. 25
|
5659 | ||
|
|
1
sep. 25
|
5180 | ||
|
|
3
juli 25
|
6170 |