From 7998eb2e18b16457474cd1f3a71c5d1988448174 Mon Sep 17 00:00:00 2001 From: odex Date: Wed, 17 Jul 2024 14:57:01 +0300 Subject: [PATCH] fix is approve overtime --- .../odex_mobile/controllers/rest_api_v2/overtime.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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 488e0a2c9..5e4a9e9a5 100644 --- a/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py +++ b/odex25_mobile/odex_mobile/controllers/rest_api_v2/overtime.py @@ -85,13 +85,14 @@ class OverTimeController(http.Controller): "reason": s.reason, "reason_msg": s.reason or "", "overtime_plase":s.overtime_plase,# http_helper.get_lable_selection(s,'overtime_plase',s.overtime_plase),# + # "benefits_discounts_list":s.benefits_discounts.read(['name']),# http_helper.get_lable_selection(s,'overtime_plase',s.overtime_plase),# } # if approvel: value.update({ 'account_id': s.sudo().account_id.name if s.sudo().account_id else False, 'journal_id': s.sudo().journal_id.name if s.sudo().journal_id else False, 'benefits_discounts': s.sudo().benefits_discounts.name if s.sudo().benefits_discounts else False, - + 'benefits_discounts_id': s.sudo().benefits_discounts.id if s.sudo().benefits_discounts else False, }) li = [] emps =[] @@ -211,6 +212,9 @@ class OverTimeController(http.Controller): "state": validator.get_state_name(s, s.state), "reason": s.reason, "overtime_plase":s.overtime_plase,# http_helper.get_lable_selection(s,'overtime_plase',s.overtime_plase),# + # "benefits_discounts_list":s.benefits_discounts.read(['name']), + 'benefits_discounts': s.sudo().benefits_discounts.name if s.sudo().benefits_discounts else False, + 'benefits_discounts_id': s.sudo().benefits_discounts.id if s.sudo().benefits_discounts else False, } li = [] if s.line_ids_over_time: @@ -299,7 +303,7 @@ class OverTimeController(http.Controller): }) elif s.transfer_type == 'payroll' and 'rule' in body : vals.update({ - 'benefits_discounts': body['rule'], + 'benefits_discounts':int( body['rule']), }) s.write(vals) if s.state == 'hr_aaproval': @@ -317,12 +321,14 @@ class OverTimeController(http.Controller): "state_name": s.state, "state": validator.get_state_name(s, s.state), "reason": s.reason, + # "benefits_discounts":s.benefits_discounts.read(['name']), } # if approvel: value.update({ 'account_id': s.sudo().account_id.name if s.sudo().account_id else False, 'journal_id': s.sudo().journal_id.name if s.sudo().journal_id else False, 'benefits_discounts': s.sudo().benefits_discounts.name if s.sudo().benefits_discounts else False, + 'benefits_discounts_id': s.sudo().benefits_discounts.id if s.sudo().benefits_discounts else False, }) li = [] @@ -463,12 +469,14 @@ class OverTimeController(http.Controller): "state": validator.get_state_name(s, s.state), "reason": s.reason, "overtime_plase":s.overtime_plase,# http_helper.get_lable_selection(s,'overtime_plase',s.overtime_plase),# + # "benefits_discounts_list":s.benefits_discounts.read(['name']), } # if approvel: value.update({ 'account_id': s.sudo().account_id.name if s.sudo().account_id else False, 'journal_id': s.sudo().journal_id.name if s.sudo().journal_id else False, 'benefits_discounts': s.sudo().benefits_discounts.name if s.sudo().benefits_discounts else False, + 'benefits_discounts_id': s.sudo().benefits_discounts.id if s.sudo().benefits_discounts else False, }) li = []