mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-14 15:11:52 +00:00
fix: delete Lead-linked Addresses on transaction deletion
The lead/address cleanup pre-escaped each address name before passing the
list into a query-builder .isin() filter, which escapes again. The
double-escaping produced `name IN ('''Addr''')`, matching nothing, so
Lead-linked Addresses were never deleted on either MariaDB or Postgres.
Pass the raw list straight into .isin() so the builder escapes once.
This commit is contained in:
@@ -702,8 +702,6 @@ class TransactionDeletionRecord(Document):
|
||||
"Dynamic Link", filters={"link_name": ("in", leads)}, pluck="parent"
|
||||
)
|
||||
if addresses:
|
||||
addresses = ["%s" % frappe.db.escape(addr) for addr in addresses]
|
||||
|
||||
address = qb.DocType("Address")
|
||||
dl1 = qb.DocType("Dynamic Link")
|
||||
dl2 = qb.DocType("Dynamic Link")
|
||||
|
||||
Reference in New Issue
Block a user