I need to get current active url in the browser and extract model from it. Is that possible?
Please Help
คำถามนี้ถูกตั้งค่าสถานะ
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_pathIn 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.
สนุกกับการพูดคุยนี้ใช่ไหม? เข้าร่วมเลย!
สร้างบัญชีวันนี้เพื่อเพลิดเพลินไปกับฟีเจอร์พิเศษและมีส่วนร่วมกับคอมมูนิตี้ที่ยอดเยี่ยมของเรา!
ลงชื่อ| Related Posts | ตอบกลับ | มุมมอง | กิจกรรม | |
|---|---|---|---|---|
|
|
1
เม.ย. 25
|
5984 | ||
|
|
3
ธ.ค. 22
|
14730 | ||
|
Add users to group through python code
แก้ไขแล้ว
|
|
6
เม.ย. 24
|
43006 | |
|
how to compute Len() of list python
แก้ไขแล้ว
|
|
3
มี.ค. 24
|
13219 | |
|
|
2
ก.ค. 19
|
765 |