Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
2109 Lượt xem

I want to show warning on date field when user fills date manually instead of filling through date picker and the date is incorrect. Suppose user manually enters the date like  35/13/2022  which is an incorrect date. So instead of removing this incorrect date and saving previously updated date, I want to set a warning message while saving the record "please enter correct date".


Current Behavior:- when user enter "32/13/2022" and click on save, it saves previously stored/saved date in database.

Expected Behavior :- when user enter "32/13/2022" and click on save, It should show a warning that date is incorrect.


Note:- I want this warning in all date fields even in default modules.

Do anyone have any idea how to achieve this?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Hello Gautam,

I have already posted the answer on stackoverflow. 

https://stackoverflow.com/questions/72485787/add-warning-for-wrong-date-while-user-manually-fill-date-in-odoo/72487702#72487702

Hope it helps!

Ảnh đại diện
Huỷ bỏ
Tác giả

hello Sidharth,

Thanks for the response but it is still saving previous stored date if the date is invalid although it shows the warning but saving previous stored date if it is incorrect. I want to restrict the user to save the record.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 3 24
4321
1
thg 12 22
2148
0
thg 6 22
2122
2
thg 3 22
8585
0
thg 7 17
3812