From f667025d924711e89906a89caf5d3adf13a8bae7 Mon Sep 17 00:00:00 2001 From: Suherdy Yacob Date: Tue, 5 May 2026 15:29:19 +0700 Subject: [PATCH] refactor: update kiosk controller routes to use jsonrpc type instead of json --- controllers/hr_expense_kiosk_controller.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/controllers/hr_expense_kiosk_controller.py b/controllers/hr_expense_kiosk_controller.py index a62cc1c..bf2274d 100644 --- a/controllers/hr_expense_kiosk_controller.py +++ b/controllers/hr_expense_kiosk_controller.py @@ -28,7 +28,7 @@ class HrExpenseKioskController(http.Controller): 'json': json, }) - @http.route('/hr_expense/kiosk_data/', type='json', auth='public') + @http.route('/hr_expense/kiosk_data/', type='jsonrpc', auth='public') def get_kiosk_data(self, token): """ Get all employees for selection. """ company = self._check_token(token) @@ -57,7 +57,7 @@ class HrExpenseKioskController(http.Controller): 'categories': products, } - @http.route('/hr_expense/kiosk_validate_pin/', type='json', auth='public') + @http.route('/hr_expense/kiosk_validate_pin/', type='jsonrpc', auth='public') def validate_pin(self, token, employee_id, pin): """ Validates the 4-digit PIN of the employee. """ if not self._check_token(token): @@ -72,14 +72,14 @@ class HrExpenseKioskController(http.Controller): else: return {'status': 'error', 'message': _("Incorrect PIN.")} - @http.route('/hr_expense/kiosk_get_pending/', type='json', auth='public') + @http.route('/hr_expense/kiosk_get_pending/', type='jsonrpc', auth='public') def get_pending(self, token, employee_id): """ Returns pending realizations for the employee. """ if not self._check_token(token): return [] return request.env['hr.expense.realization'].sudo().get_pending_realizations(employee_id) - @http.route('/hr_expense/kiosk_get_submitted/', type='json', auth='public') + @http.route('/hr_expense/kiosk_get_submitted/', type='jsonrpc', auth='public') def get_submitted(self, token, employee_id): """ Returns submitted expenses for the employee. """ if not self._check_token(token): @@ -110,7 +110,7 @@ class HrExpenseKioskController(http.Controller): }) return result - @http.route('/hr_expense/kiosk_submit_realization/', type='json', auth='public') + @http.route('/hr_expense/kiosk_submit_realization/', type='jsonrpc', auth='public') def submit_realization(self, token, employee_id, expense_id, lines=None): """ Creates a realization report from the kiosk. """ if not self._check_token(token): @@ -146,7 +146,7 @@ class HrExpenseKioskController(http.Controller): except Exception as e: return {'status': 'error', 'message': str(e)} - @http.route('/hr_expense/kiosk_submit_new_expense/', type='json', auth='public') + @http.route('/hr_expense/kiosk_submit_new_expense/', type='jsonrpc', auth='public') def submit_new_expense(self, token, employee_id, product_id, amount, description, payment_mode=None, image_base64=None): """ Creates a new expense (e.g. out of pocket) from the kiosk. """ if not self._check_token(token):