[fix] Clear notification count while deleting company transactions
This commit is contained in:
parent
a1fa659475
commit
0ca3e3d89e
@ -6,6 +6,7 @@ import frappe
|
|||||||
|
|
||||||
from frappe.utils import cint
|
from frappe.utils import cint
|
||||||
from frappe import _
|
from frappe import _
|
||||||
|
from frappe.desk.notifications import clear_notifications
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def delete_company_transactions(company_name):
|
def delete_company_transactions(company_name):
|
||||||
@ -24,6 +25,9 @@ def delete_company_transactions(company_name):
|
|||||||
if doctype not in ("Account", "Cost Center", "Warehouse", "Budget Detail", "Party Account"):
|
if doctype not in ("Account", "Cost Center", "Warehouse", "Budget Detail", "Party Account"):
|
||||||
delete_for_doctype(doctype, company_name)
|
delete_for_doctype(doctype, company_name)
|
||||||
|
|
||||||
|
# Clear notification counts
|
||||||
|
clear_notifications()
|
||||||
|
|
||||||
def delete_for_doctype(doctype, company_name):
|
def delete_for_doctype(doctype, company_name):
|
||||||
meta = frappe.get_meta(doctype)
|
meta = frappe.get_meta(doctype)
|
||||||
company_fieldname = meta.get("fields", {"fieldtype": "Link",
|
company_fieldname = meta.get("fields", {"fieldtype": "Link",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user