Skip to content

Commit

Permalink
Merge pull request #43411 from frappe/mergify/bp/version-15-hotfix/pr…
Browse files Browse the repository at this point in the history
…-43410

fix: Ignore transaction deletion check on ledger entry insertion (#43410)
  • Loading branch information
deepeshgarg007 authored Sep 27, 2024
2 parents 74c880c + 1d6f97a commit 6d66002
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 6d66002

Please sign in to comment.