From 1bbe020cfde623a234ba71f9b9ca81bcf6b7253c Mon Sep 17 00:00:00 2001 From: HENRY Florian Date: Fri, 19 Jul 2024 12:52:11 +0200 Subject: [PATCH] feat: add make_regional_gl_entries override for Sales Invoice (#42399) * feat: add make_regional_gl_entries override for Sales Invoice and Stock Controler * chore: remove regionnal override for stock management --- erpnext/accounts/doctype/sales_invoice/sales_invoice.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py index 842b5a35b2a7..b279ead5286c 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice.py +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice.py @@ -1219,6 +1219,8 @@ def get_gl_entries(self, warehouse_account=None): self.make_precision_loss_gl_entry(gl_entries) self.make_discount_gl_entries(gl_entries) + gl_entries = make_regional_gl_entries(gl_entries, self) + # merge gl entries before adding pos entries gl_entries = merge_similar_entries(gl_entries) @@ -2192,6 +2194,11 @@ def make_inter_company_purchase_invoice(source_name, target_doc=None): return make_inter_company_transaction("Sales Invoice", source_name, target_doc) +@erpnext.allow_regional +def make_regional_gl_entries(gl_entries, doc): + return gl_entries + + def make_inter_company_transaction(doctype, source_name, target_doc=None): if doctype in ["Sales Invoice", "Sales Order"]: source_doc = frappe.get_doc(doctype, source_name)