feat: Add hook to update gl dict by apps

(cherry picked from commit 10ff369ff2)
This commit is contained in:
Deepesh Garg
2025-06-05 12:42:16 +05:30
committed by Mergify
parent 1b1550708d
commit 76c2477d23

View File

@@ -1151,6 +1151,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()
@@ -3937,3 +3939,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)