Since saas-3, website controllers use `request.website.render` to render the template of a web page. This was kept for retro compatibility. It's time to stop using deprecated stuff. Same for `_render` method on website. 'json' route don't use `request.render` since `JsonRequest` has no `render` method.
16 lines
645 B
Python
16 lines
645 B
Python
# -*- coding: utf-8 -*-
|
|
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
|
|
|
from odoo import http
|
|
from odoo.http import request
|
|
|
|
class WebsiteHr(http.Controller):
|
|
|
|
@http.route(['/page/website.aboutus', '/page/aboutus'], type='http', auth="public", website=True)
|
|
def blog(self, **post):
|
|
employees_domain = []
|
|
if not request.env['res.users'].has_group('base.group_website_publisher'):
|
|
employees_domain += [('website_published', '=', True)]
|
|
employees = request.env['hr.employee'].search(employees_domain)
|
|
return request.render("website.aboutus", {'employees': employees})
|