Skip to content

Commit e830cca

Browse files
feat(asset): make asset depreciation failure notification role configurable
1 parent a8d3e9b commit e830cca

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

erpnext/accounts/doctype/accounts_settings/accounts_settings.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
"calculate_depr_using_total_days",
7474
"column_break_gjcc",
7575
"book_asset_depreciation_entry_automatically",
76+
"role_used_for_depreciation_failure",
7677
"closing_settings_tab",
7778
"period_closing_settings_section",
7879
"acc_frozen_upto",
@@ -658,6 +659,13 @@
658659
"fieldname": "use_legacy_controller_for_pcv",
659660
"fieldtype": "Check",
660661
"label": "Use Legacy Controller For Period Closing Voucher"
662+
},
663+
{
664+
"description": "Users with this role will be notified if the asset depreciation gets failed",
665+
"fieldname": "role_used_for_depreciation_failure",
666+
"fieldtype": "Link",
667+
"label": "Role used for Depreciation Failure",
668+
"options": "Role"
661669
}
662670
],
663671
"grid_page_length": 50,
@@ -666,7 +674,7 @@
666674
"index_web_pages_for_search": 1,
667675
"issingle": 1,
668676
"links": [],
669-
"modified": "2025-10-20 14:06:08.870427",
677+
"modified": "2025-11-24 23:36:21.829372",
670678
"modified_by": "Administrator",
671679
"module": "Accounts",
672680
"name": "Accounts Settings",

erpnext/accounts/doctype/accounts_settings/accounts_settings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ class AccountsSettings(Document):
6565
reconciliation_queue_size: DF.Int
6666
role_allowed_to_over_bill: DF.Link | None
6767
role_to_override_stop_action: DF.Link | None
68+
role_used_for_depreciation_failure: DF.Link | None
6869
round_row_wise_tax: DF.Check
6970
show_balance_in_coa: DF.Check
7071
show_inclusive_tax_in_print: DF.Check

erpnext/assets/doctype/asset/depreciation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ def set_depr_entry_posting_status_for_failed_assets(failed_asset_names):
307307

308308

309309
def notify_depr_entry_posting_error(failed_asset_names, error_log_names):
310-
recipients = get_users_with_role("Accounts Manager")
310+
user_role = frappe.db.get_single_value("Accounts Settings", "role_used_for_depreciation_failure")
311+
recipients = get_users_with_role(user_role or "Accounts Manager")
311312

312313
if not recipients:
313314
recipients = get_users_with_role("System Manager")

0 commit comments

Comments
 (0)