mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 21:19:19 +00:00
fix: prevent duplicate task execution and timestamp error in transaction deletion (#55021)
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user