How to set my date default value as 05/08/2022??
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- 客户关系管理
- e-Commerce
- 会计
- 库存
- PoS
- Project
- MRP
此问题已终结
1
回复
2859
查看
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?
相关帖文 | 回复 | 查看 | 活动 | |
---|---|---|---|---|
|
1
6月 25
|
1721 | ||
|
3
7月 25
|
3339 | ||
|
1
5月 25
|
1485 | ||
|
1
5月 25
|
1743 | ||
|
4
5月 25
|
2875 |