Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
2113 มุมมอง

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?

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

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!

อวตาร
ละทิ้ง
ผู้เขียน

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.

Related Posts ตอบกลับ มุมมอง กิจกรรม
3
มี.ค. 24
4322
1
ธ.ค. 22
2149
0
มิ.ย. 22
2125
How can I convert a date to a datetime? แก้ไขแล้ว
2
มี.ค. 22
8586
0
ก.ค. 17
3813