I need to get current active url in the browser and extract model from it. Is that possible?
Please Help
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ờ
In Python
from openerp import http
print http.request.env['ir.config_parameter'].get_param('web.base.url') # BASE URL
print http.request.httprequest
print http.request.httprequest.full_path
In Javascript
window.location.href
In js, it will return the previous menu item url, In Python it does not return full url.
I need a menu id from current url.
from openerp.http import request
print request.httprequest.url_root
Or:
base_url = self.env['ir.config_parameter'].get_param('web.base.url')
from odoo.http import request
check out/print:
request.httprequest.url
request.httprequest.base_url
request.httprequest.host_url
Hello Tessnim
you can try
1 .
from openerp.http import request
print(request.httprequest.__dict__)
or
2. refer link
\ https://www.odoo.com/forum/help-1/question/how-to-get-url-of-current-page-29394
Thanx.
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 4 25
|
3161 | ||
|
3
thg 12 22
|
10965 | ||
|
6
thg 4 24
|
38166 | ||
how to compute Len() of list python
Đã xử lý
|
|
3
thg 3 24
|
10117 | |
|
2
thg 7 19
|
765 |