diff --git a/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py b/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py index 5e4a9e9a5..7ef41d218 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py @@ -296,12 +296,13 @@ class OverTimeController(http.Controller): } # if approvel: - if s.transfer_type == 'accounting' and 'account' in body and 'journal' in body: + s.write(vals) + if s.transfer_type == 'accounting' and body.get("account") and body.get("journal"): vals.update({ 'account_id': body['account'], 'journal_id': body['journal'], }) - elif s.transfer_type == 'payroll' and 'rule' in body : + elif s.transfer_type == 'payroll' and body.get("rule") : vals.update({ 'benefits_discounts':int( body['rule']), })