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

Why do I have to patch backend code to make specific http codes work????


I followed https://stackoverflow.com/a/67662363 and it worked, why does Odoo not support returning custom http status code in controller that has type=json??


Why is http code always hardcoded to 200? (unless we raise 3 very specific exceptions (NotFound, AuthenticationError, SessionExpiredException) you can see this here https://github.com/odoo/odoo/blob/8a8faa79929448ebd87dd58b3a7486717616334f/odoo/http.py#L654

I swear working with Odoo is so frustrating.


Is there any other way aside from monkeypatching?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 23
11926
7
thg 1 24
49557
2
thg 10 20
3750
1
thg 8 20
17242
0
thg 2 21
3452