Skip to content

Commit

Permalink
fix: Ignore transaction deletion check on ledger entry insertion
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Sep 27, 2024
1 parent e4e96d2 commit 998f6a9
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 998f6a9

Please sign in to comment.