Skip to content

Commit

Permalink
fix: fetch swift_number in payment_request
Browse files Browse the repository at this point in the history
There isn't direct link between payment_request and bank so swift_number wasn't fetched using Fetch form. I fixed it by fetching swift_number on_change of bank_account.

(cherry picked from commit f42a8e4)
  • Loading branch information
maharshivpatel authored and mergify[bot] committed Oct 3, 2022
1 parent caedc9f commit 6074570
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 7 additions & 0 deletions erpnext/accounts/doctype/payment_request/payment_request.js
Expand Up @@ -9,6 +9,13 @@ frappe.ui.form.on("Payment Request", {
query: "erpnext.setup.doctype.party_type.party_type.get_party_type",
};
});
},
"bank_account": function(frm) {
frappe.db.get_value('Bank', frm.doc.bank, ['swift_number'])
.then(r => {
let values = r.message;
frm.set_value('swift_number', values.swift_number)
})
}
})

Expand Down
Expand Up @@ -219,7 +219,6 @@
"label": "Branch Code"
},
{
"fetch_from": "bank.swift_number",
"fieldname": "swift_number",
"fieldtype": "Read Only",
"label": "SWIFT Number"
Expand Down Expand Up @@ -366,7 +365,7 @@
"index_web_pages_for_search": 1,
"is_submittable": 1,
"links": [],
"modified": "2020-09-18 12:24:14.178853",
"modified": "2022-09-28 12:39:30.160837",
"modified_by": "Administrator",
"module": "Accounts",
"name": "Payment Request",
Expand Down

0 comments on commit 6074570

Please sign in to comment.