From 17ef3c964f194816c60d49fa8ec471b184869d3e Mon Sep 17 00:00:00 2001 From: Sagar Vora Date: Tue, 4 Apr 2023 17:49:50 +0530 Subject: [PATCH] fix: set `frappe.flags.company` to call regional code accurately --- erpnext/accounts/party.py | 2 ++ erpnext/controllers/taxes_and_totals.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index ac9368e69c..7747042825 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -259,6 +259,8 @@ def set_address_details( ) if doctype in TRANSACTION_TYPES: + # required to set correct region + frappe.flags.company = company get_regional_address_details(party_details, doctype, company) return party_address, shipping_address diff --git a/erpnext/controllers/taxes_and_totals.py b/erpnext/controllers/taxes_and_totals.py index 1edd7bf85e..4661c5ca7e 100644 --- a/erpnext/controllers/taxes_and_totals.py +++ b/erpnext/controllers/taxes_and_totals.py @@ -976,6 +976,8 @@ def get_itemised_tax_breakup_html(doc): @frappe.whitelist() def get_round_off_applicable_accounts(company, account_list): + # required to set correct region + frappe.flags.company = company account_list = get_regional_round_off_accounts(company, account_list) return account_list