Impacted versions: 12
Steps to reproduce: If we set a onchange function for a Date field and if that onchange function has some code to raise a ValidationError or UserError.
Current behavior: Then the onchange function keeps executing if you click on the Date field to select, means without changing the date, it executes. So the error popup appear again and again. So not able to change the date.
Expected behavior: As I checked with Char field it works fine. So the onchange function has to be only executed for the Date field when the current value in the field is different from the last value.
Sample code:
@api.onchange('today_date')
def change_date(self):
if self.today_date == datetime.datetime.today().date():
raise ValidationError("Selected today's Date >>>>>>>>>>>>>>")
When I select todays date in the field, it raise the error. Now I want to select some other date and clicked the field to change, before I change it gives the error again and again.
I faced this issue with Odoo ver 12.
Odoo 13 and 14 don't have this type of issue.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
3351
Lượt xem
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
3
thg 10 23
|
9153 | ||
|
1
thg 9 23
|
3441 | ||
|
1
thg 5 23
|
2428 | ||
|
2
thg 4 23
|
3001 | ||
Inherit Element form kanban View
Đã xử lý
|
|
1
thg 3 23
|
2372 |