mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-17 17:26:43 +00:00
fix: Ignore transaction deletion check on ledger entry insertion
(cherry picked from commit 998f6a92a4)
This commit is contained in:
@@ -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):
|
def check_for_running_deletion_job(doc, method=None):
|
||||||
# Check if DocType has 'company' field
|
# Check if DocType has 'company' field
|
||||||
df = qb.DocType("DocField")
|
if doc.doctype not in ("GL Entry", "Payment Ledger Entry", "Stock Ledger Entry"):
|
||||||
if qb.from_(df).select(df.parent).where((df.fieldname == "company") & (df.parent == doc.doctype)).run():
|
df = qb.DocType("DocField")
|
||||||
is_deletion_doc_running(
|
if (
|
||||||
doc.company, _("Cannot make any transactions until the deletion job is completed")
|
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")
|
||||||
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user