mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-05 13:24:47 +00:00
fix: skip application fetch for non allocation records
This commit is contained in:
@@ -34,12 +34,15 @@ def delete_ledger_entry(ledger):
|
|||||||
{'transaction_name': ledger.transaction_name},
|
{'transaction_name': ledger.transaction_name},
|
||||||
['name', 'creation']
|
['name', 'creation']
|
||||||
)
|
)
|
||||||
leave_application_records = frappe.get_all("Leave Ledger Entry",
|
|
||||||
filters={
|
leave_application_records = []
|
||||||
'transaction_type': 'Leave Application',
|
if ledger.transaction_type == "Leave Allocation":
|
||||||
'creation_date': (">", creation_date)
|
leave_application_records = frappe.get_all("Leave Ledger Entry",
|
||||||
},
|
filters={
|
||||||
fields=['transaction_type'])
|
'transaction_type': 'Leave Application',
|
||||||
|
'creation_date': (">", creation_date)
|
||||||
|
},
|
||||||
|
fields=['transaction_type'])
|
||||||
if not leave_application_records:
|
if not leave_application_records:
|
||||||
frappe.delete_doc("Leave Ledger Entry", ledger_entry)
|
frappe.delete_doc("Leave Ledger Entry", ledger_entry)
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user