mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-19 13:09:17 +00:00
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:
@@ -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(
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user