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:
- 客戶關係
- e-Commerce
- 會計
- 庫存
- PoS
- Project
- MRP
此問題已被標幟
2
回覆
3384
瀏覽次數
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. 😒
相關帖文 | 回覆 | 瀏覽次數 | 活動 | |
---|---|---|---|---|
|
1
8月 22
|
3010 | ||
|
2
1月 18
|
4675 | ||
|
2
8月 25
|
517 | ||
|
5
8月 25
|
10008 | ||
|
2
7月 25
|
1054 |