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
- प्रोजेक्ट
- MRP
This question has been flagged
2
Replies
3972
Views
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. 😒
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up| Related Posts | Replies | Views | Activity | |
|---|---|---|---|---|
|
|
1
अग॰ 22
|
3506 | ||
|
|
2
जन॰ 18
|
5165 | ||
|
|
3
सित॰ 25
|
2505 | ||
|
Login Website
Solved
|
|
3
अक्तू॰ 25
|
149265 | |
|
|
1
सित॰ 25
|
1840 |