patch_mission
This commit is contained in:
parent
08274948c4
commit
72234eb1df
|
|
@ -496,7 +496,19 @@ class HrOfficialMissionController(http.Controller):
|
||||||
|
|
||||||
for field_name in updatable_fields:
|
for field_name in updatable_fields:
|
||||||
if field_name in body:
|
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):
|
# example for department_id (many2many):
|
||||||
if "department_id" in body:
|
if "department_id" in body:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue