How can I run a code block on every request a website user makes. Let's say I want to pre-select the pricelist based on the user ip, how do I run a pre-controller hook or middleware?
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ờ
request dispatch method will call on every request
https://github.com/odoo/odoo/blob/14.0/odoo/http.py#L1306
you can override the despatch for both http or json request
@Ravi Gadhia
Thank you so much!!! I had to monkey patch the whole HttpRequest class, but it was worth it. You have no idea how helpful it was.
PS: I do not have enough karma to mark this as solved. 😒
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 | |
---|---|---|---|---|
|
1
thg 8 22
|
2980 | ||
|
2
thg 1 18
|
4644 | ||
|
2
thg 8 25
|
411 | ||
|
5
thg 8 25
|
9965 | ||
Carrusel en sitios web
Đã xử lý
|
|
2
thg 7 25
|
1025 |