Merge pull request #20732 from deepeshgarg007/loan_security_pledge_api

fix: API fix for loan security pledge creation
This commit is contained in:
Deepesh Garg 2020-02-26 12:59:13 +05:30 committed by GitHub
commit 9f4b46050f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -147,7 +147,7 @@ def create_loan(source_name, target_doc=None, submit=0):
return doclist
@frappe.whitelist()
def create_pledge(loan_application):
def create_pledge(loan_application, loan=None):
loan_application_doc = frappe.get_doc("Loan Application", loan_application)
lsp = frappe.new_doc("Loan Security Pledge")
@ -156,6 +156,9 @@ def create_pledge(loan_application):
lsp.loan_application = loan_application_doc.name
lsp.company = loan_application_doc.company
if loan:
lsp.loan = loan
for pledge in loan_application_doc.proposed_pledges:
lsp.append('securities', {