Merge pull request #3332 from expsa/salarise_endpoin

patch_mission
This commit is contained in:
mohammed-alkhazrji 2025-05-28 14:55:13 +03:00 committed by GitHub
commit 213ef0ff86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 13 additions and 1 deletions

View File

@ -496,7 +496,19 @@ class HrOfficialMissionController(http.Controller):
for field_name in updatable_fields:
if field_name in body:
vals[field_name] = body[field_name]
value = body[field_name]
if field_name in ['mission_type', 'destination']:
try:
value = int(value)
except:
return http_helper.response(
code=400,
message=_("Invalid type for field '%s': expected integer.") % field_name,
success=False
)
vals[field_name] = value
# example for department_id (many2many):
if "department_id" in body: