refactor: update kiosk controller routes to use jsonrpc type instead of json
This commit is contained in:
parent
6fc645230d
commit
f667025d92
@ -28,7 +28,7 @@ class HrExpenseKioskController(http.Controller):
|
||||
'json': json,
|
||||
})
|
||||
|
||||
@http.route('/hr_expense/kiosk_data/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_data/<string:token>', 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/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_validate_pin/<string:token>', 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/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_get_pending/<string:token>', 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/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_get_submitted/<string:token>', 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/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_submit_realization/<string:token>', 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/<string:token>', type='json', auth='public')
|
||||
@http.route('/hr_expense/kiosk_submit_new_expense/<string:token>', 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):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user