mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-30 07:08:24 +00:00
Merge pull request #58426 from frappe/mergify/bp/version-15-hotfix/pr-58351
fix(company): throw if linked to demo_company field (backport #58351)
This commit is contained in:
@@ -667,6 +667,13 @@ class Company(NestedSet):
|
|||||||
"""
|
"""
|
||||||
Trash accounts and cost centers for this company if no gl entry exists
|
Trash accounts and cost centers for this company if no gl entry exists
|
||||||
"""
|
"""
|
||||||
|
if frappe.db.get_single_value("Global Defaults", "demo_company") == self.name:
|
||||||
|
frappe.throw(
|
||||||
|
_("{0} is the site's Demo Company and cannot be deleted directly. Use {1} instead.").format(
|
||||||
|
self.name, _("Delete Demo Data")
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
NestedSet.validate_if_child_exists(self)
|
NestedSet.validate_if_child_exists(self)
|
||||||
frappe.utils.nestedset.update_nsm(self)
|
frappe.utils.nestedset.update_nsm(self)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user