Skip to Content
Menu
This question has been flagged
1 Reply
983 Views
I implemented a REST API on odoo using a controller.

the API receives the contact id which I need to use to open the main contact page.

I tried with request.redirect but it doesn't work

"request.redirect("http://127.0.0.1:8069/web#id=26&cids=1&menu_id=338&action=475&model=res.partner&view_type=form")

Thanks in advance.


Avatar
Discard
Best Answer

Hello VOIP_CRM,

You can redirect to contact page from odoo controller.

Find Example in comment.

I hope this will help you.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Discard

For Example -

def get_contact_url(self):
"""This method will return url"""
action_id = self.env.ref('contacts.Your_template_id')
url = self.env['ir.config_parameter'].sudo().get_param('web.base.url')
contact_url = '/web#id=%s' % (self.id) + '&action=%s' % (action_id.id) + '&model=res.partner&view_type=form'
return url + contact_url