commit
0bcb4278a3
|
|
@ -2,7 +2,6 @@
|
|||
import werkzeug
|
||||
from odoo import http,tools
|
||||
from odoo.http import request, Response
|
||||
from odoo.addons.auth_signup.models.res_users import SignupError
|
||||
from odoo.exceptions import UserError
|
||||
import base64
|
||||
from ...validator import validator
|
||||
|
|
@ -126,9 +125,18 @@ class LoanController(http.Controller):
|
|||
'months':body['months'],
|
||||
})
|
||||
if loans:
|
||||
value = {'id': loans.id, 'code': loans.code, 'expect_amount': loans.emp_expect_amount, 'date': str(loans.date),
|
||||
'state_name':loans.state, 'installment_amount': loans.installment_amount, 'state': validator.get_state_name(loans,loans.state), 'months': loans.months,
|
||||
'request_type_id':loans.request_type.id, 'request_type_name':loans.request_type.name}
|
||||
value = {
|
||||
"id": loans.id,
|
||||
"code": loans.code,
|
||||
"expect_amount": loans.emp_expect_amount,
|
||||
"date": str(loans.date),
|
||||
"state_name": loans.state,
|
||||
"installment_amount": loans.installment_amount,
|
||||
"state": validator.get_state_name(loans, loans.state),
|
||||
"months": loans.months,
|
||||
"request_type_id": loans.request_type.id,
|
||||
"request_type_name": loans.request_type.name,
|
||||
}
|
||||
lines = []
|
||||
if loans.deduction_lines:
|
||||
for l in loans.deduction_lines:
|
||||
|
|
@ -271,4 +279,4 @@ class LoanController(http.Controller):
|
|||
except Exception as e:
|
||||
_logger.error(str(e))
|
||||
message = validator.get_server_error(e, user)
|
||||
return http_helper.errcode(code=403, message=message)
|
||||
return http_helper.errcode(code=403, message=message)
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class Users(models.Model):
|
|||
d["job"] = employee.job_id.name if employee and employee.job_id else None
|
||||
d["employe_id"] = employee.id if employee and employee.id else None
|
||||
d["attendance_status"] = attendance_status if attendance_status else None
|
||||
|
||||
d['is_approve'] = 'group_division_manager' in d.get('groups',[])
|
||||
res.append(d)
|
||||
|
||||
return res[0] if single else res
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue