Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I want to fetch the current url like this :http://localhost:8069/web?debug=#id=10&view_type=form&model=crm.lead&action=251
How can we do that? i've tried with several ways but didn't work for me. I can get the base url using config parameter but not ful URL.
Hi Prince, You try my way
refer : https://www.odoo.com/forum/help-1/question/odoo-9-website-js-help-109603#answer-109604
Pass the current url in that function
ajax.jsonRpc("/action_set_current_url/", 'call', window.location.href)
Step2: In python function, Set the current url to session.
from openerp import http
from openerp.http import request
@http.route(['/action_set_current_url/<string:url>'], type='json', auth="public")
def set_current_url(self, url,**post):
# CODE TO SET COOKIES
request.session['my_current_url'] = url
Call the current url from your function
# CODE TO GET URL
current_url = request.session.get('my_current_url')
Note : my code is not tested
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 10/30/16, 10:58 AM|
|Seen: 545 times|
|Last updated: 11/1/16, 9:30 PM|