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

Co-authored-by: Nabin Hait <nabinhait@gmail.com>
fix: prevent duplicate task execution and timestamp error in transaction deletion (#55021)
This commit is contained in:
mergify[bot]
2026-05-18 17:55:05 +00:00
committed by GitHub
parent ff0533d085
commit 9857cc64d6
3 changed files with 5 additions and 6 deletions

View File

@@ -1085,7 +1085,6 @@ def create_transaction_deletion_request(company):
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

@@ -736,10 +736,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")