20 lines
665 B
Python
20 lines
665 B
Python
from odoo import http
|
|
from odoo.http import request, route
|
|
|
|
|
|
class NoticeController(http.Controller):
|
|
@http.route(["/web_notice"], type="http", auth="public")
|
|
def show_playground(self):
|
|
"""
|
|
Renders the owl playground page
|
|
"""
|
|
return request.render("yuthon_web_notice.Announcement")
|
|
|
|
@http.route("/web_notice/employee/<int:employee_id>", type="json", auth="public")
|
|
def get_employee(self, employee_id):
|
|
employee = request.env["hr.employee"].sudo().browse(employee_id)
|
|
if not employee.exists():
|
|
return {}
|
|
fields = employee.fields_get().keys()
|
|
return employee.read(fields)[0]
|