From 10ff369ff23f9c65d7d8d508186d50481ccf19ea Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 5 Jun 2025 12:42:16 +0530 Subject: [PATCH] feat: Add hook to update gl dict by apps --- erpnext/controllers/accounts_controller.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/erpnext/controllers/accounts_controller.py b/erpnext/controllers/accounts_controller.py index a4bc937ea4d..421255b392f 100644 --- a/erpnext/controllers/accounts_controller.py +++ b/erpnext/controllers/accounts_controller.py @@ -1248,6 +1248,8 @@ class AccountsController(TransactionBase): with temporary_flag("company", self.company): update_gl_dict_with_regional_fields(self, gl_dict) + update_gl_dict_with_app_based_fields(self, gl_dict) + accounting_dimensions = get_accounting_dimensions() dimension_dict = frappe._dict() @@ -4051,3 +4053,7 @@ def validate_einvoice_fields(doc): @erpnext.allow_regional def update_gl_dict_with_regional_fields(doc, gl_dict): pass + +def update_gl_dict_with_app_based_fields(doc, gl_dict): + for method in frappe.get_hooks("update_gl_dict_with_app_based_fields", default=[]): + frappe.get_attr(method)(doc, gl_dict) \ No newline at end of file