Webpage redirection using Odoo Controller
from odoo import http
from odoo.http import request
class Custom(http.Controller):
@http.route('/oldpage', auth='public', website=True)
def newpage_redirect(self):
return request.redirect('newpage')
@http.route('/newpage', auth='public', website=True)
def newpage_render(self):
return http.request.render('appname.newpage', {})
Using the above code we can redirect the oldpage to newpage.
No comments:
Post a Comment