@@ -388,17 +388,11 @@ class TransactionDeletionRecord(Document):
|
|||||||
frappe.delete_doc("Communication", batch, ignore_permissions=True)
|
frappe.delete_doc("Communication", batch, ignore_permissions=True)
|
||||||
|
|
||||||
def delete_comments(self, doctype, reference_doc_names):
|
def delete_comments(self, doctype, reference_doc_names):
|
||||||
comments = frappe.get_all(
|
if reference_doc_names:
|
||||||
"Comment",
|
comment = qb.DocType("Comment")
|
||||||
filters={"reference_doctype": doctype, "reference_name": ["in", reference_doc_names]},
|
qb.from_(comment).delete().where(
|
||||||
)
|
(comment.reference_doctype == doctype) & (comment.reference_name.isin(reference_doc_names))
|
||||||
comment_names = [c.name for c in comments]
|
).run()
|
||||||
|
|
||||||
if not comment_names:
|
|
||||||
return
|
|
||||||
|
|
||||||
for batch in create_batch(comment_names, self.batch_size):
|
|
||||||
frappe.delete_doc("Comment", batch, ignore_permissions=True)
|
|
||||||
|
|
||||||
def unlink_attachments(self, doctype, reference_doc_names):
|
def unlink_attachments(self, doctype, reference_doc_names):
|
||||||
files = frappe.get_all(
|
files = frappe.get_all(
|
||||||
|
|||||||
Reference in New Issue
Block a user