Skip to content

Commit

Permalink
Merge pull request #43413 from frappe/mergify/bp/version-15/pr-43411
Browse files Browse the repository at this point in the history
fix: Ignore transaction deletion check on ledger entry insertion (#43410)
  • Loading branch information
deepeshgarg007 authored Sep 27, 2024
2 parents 8d188dc + c1f14f2 commit a5fa287
Showing 1 changed file with 11 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,14 @@ def is_deletion_doc_running(company: str | None = None, err_msg: str | None = No

def check_for_running_deletion_job(doc, method=None):
# Check if DocType has 'company' field
df = qb.DocType("DocField")
if qb.from_(df).select(df.parent).where((df.fieldname == "company") & (df.parent == doc.doctype)).run():
is_deletion_doc_running(
doc.company, _("Cannot make any transactions until the deletion job is completed")
)
if doc.doctype not in ("GL Entry", "Payment Ledger Entry", "Stock Ledger Entry"):
df = qb.DocType("DocField")
if (
qb.from_(df)
.select(df.parent)
.where((df.fieldname == "company") & (df.parent == doc.doctype))
.run()
):
is_deletion_doc_running(
doc.company, _("Cannot make any transactions until the deletion job is completed")
)

0 comments on commit a5fa287

Please sign in to comment.