fix bug
This commit is contained in:
parent
d8cefdabe3
commit
a41a0eb301
|
|
@ -512,6 +512,10 @@ class EmployeeOtherRequestController(http.Controller):
|
|||
success=False
|
||||
)
|
||||
|
||||
employee = http.request.env['hr.employee'].search([('user_id', '=', user.id)], limit=1)
|
||||
if not employee:
|
||||
return http_helper.response(code=400, message=_(
|
||||
"You Have issue in your employee profile. please check with one of your team admins"), success=False)
|
||||
try:
|
||||
# 2) Parse Query params
|
||||
page = int(kw.get("page", 1))
|
||||
|
|
@ -519,7 +523,7 @@ class EmployeeOtherRequestController(http.Controller):
|
|||
approvel = kw.get("approvel", 0)
|
||||
filters_str = kw.get("filters", "") # e.g. 'state=approved'
|
||||
page, offset, limit, prev = validator.get_page_pagination(page)
|
||||
domain = []
|
||||
domain = [('employee_id', '=', employee.id)]
|
||||
if approvel:
|
||||
domain.append(('state', '!=', 'draft'))
|
||||
if filters_str:
|
||||
|
|
|
|||
|
|
@ -344,6 +344,10 @@ class HrOfficialMissionController(http.Controller):
|
|||
message=_("Authentication failed or user is not allowed."),
|
||||
success=False)
|
||||
|
||||
employee = http.request.env['hr.employee'].search([('user_id', '=', user.id)], limit=1)
|
||||
if not employee:
|
||||
return http_helper.response(code=400, message=_(
|
||||
"You Have issue in your employee profile. please check with one of your team admins"), success=False)
|
||||
try:
|
||||
# 2) Build domain & pagination
|
||||
page = int(kw.get('page', 1))
|
||||
|
|
@ -352,7 +356,7 @@ class HrOfficialMissionController(http.Controller):
|
|||
filters_str = kw.get('filters')
|
||||
page, offset, limit, prev = validator.get_page_pagination(page)
|
||||
|
||||
domain = []
|
||||
domain = [('employee_id', '=', employee.id)]
|
||||
if approvel:
|
||||
domain.append(('state', '!=', 'draft'))
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue