fix: prevent duplicate task execution and timestamp error in transaction deletion (#55021)

This commit is contained in:
Nabin Hait
2026-05-18 23:06:09 +05:30
committed by GitHub
parent 21a9eedb5c
commit f99e331742
3 changed files with 5 additions and 6 deletions

View File

@@ -1087,7 +1087,6 @@ def create_transaction_deletion_request(company: str):
tdr.reload()
tdr.submit()
tdr.start_deletion_tasks()
frappe.msgprint(
_("Transaction Deletion Document {0} has been triggered for company {1}").format(

View File

@@ -396,7 +396,6 @@ def create_and_submit_transaction_deletion_doc(company):
tdr.process_in_single_transaction = True
tdr.submit()
tdr.start_deletion_tasks()
return tdr

View File

@@ -738,10 +738,11 @@ class TransactionDeletionRecord(Document):
self.enqueue_task(task="Clear Notifications")
return
company_obj = frappe.get_doc("Company", self.company)
company_obj.total_monthly_sales = 0
company_obj.sales_monthly_history = None
company_obj.save()
frappe.db.set_value(
"Company",
self.company,
{"total_monthly_sales": 0, "sales_monthly_history": None},
)
self.db_set("reset_company_default_values_status", "Completed")
self.enqueue_task(task="Clear Notifications")