feat: add validation for fetching doc status
diff --git a/erpnext/accounts/doctype/payment_entry/payment_entry.py b/erpnext/accounts/doctype/payment_entry/payment_entry.py
index 601813d..c506090 100644
--- a/erpnext/accounts/doctype/payment_entry/payment_entry.py
+++ b/erpnext/accounts/doctype/payment_entry/payment_entry.py
@@ -978,7 +978,7 @@
target_doc.bank_account = source_parent.bank_account
target_doc.amount = source_parent.base_paid_amount
target_doc.account = source_parent.paid_to
- target_doc.payment_entry = source_doc.name
+ target_doc.payment_entry = source_parent.name
target_doc.supplier = source_parent.party
target_doc.mode_of_payment = source_parent.mode_of_payment
@@ -986,9 +986,15 @@
doclist = get_mapped_doc("Payment Entry", source_name, {
"Payment Entry": {
"doctype": "Payment Order",
+ "validation": {
+ "docstatus": ["=", 1]
+ }
},
"Payment Entry Reference": {
"doctype": "Payment Order Reference",
+ "validation": {
+ "docstatus": ["=", 1]
+ },
"postprocess": update_item
},