From 010bd9c558b67223224e6d7840b8abe7b6aa8d0e Mon Sep 17 00:00:00 2001 From: Daizy Modi Date: Thu, 3 Nov 2022 14:36:48 +0530 Subject: [PATCH] fix: remove cache param --- erpnext/accounts/doctype/pos_invoice/pos_invoice.py | 2 +- erpnext/accounts/party.py | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py index 81c19858c0..b543016eaa 100644 --- a/erpnext/accounts/doctype/pos_invoice/pos_invoice.py +++ b/erpnext/accounts/doctype/pos_invoice/pos_invoice.py @@ -534,7 +534,7 @@ class POSInvoice(SalesInvoice): if not self.debit_to: self.debit_to = get_party_account("Customer", self.customer, self.company) self.party_account_currency = frappe.get_cached_value( - "Account", self.debit_to, "account_currency", cache=True + "Account", self.debit_to, "account_currency" ) if not self.due_date and self.customer: self.due_date = get_due_date(self.posting_date, "Customer", self.customer, self.company) diff --git a/erpnext/accounts/party.py b/erpnext/accounts/party.py index aa0e39b932..baeed03a0f 100644 --- a/erpnext/accounts/party.py +++ b/erpnext/accounts/party.py @@ -385,7 +385,7 @@ def get_party_account(party_type, party=None, company=None): existing_gle_currency = get_party_gle_currency(party_type, party, company) if existing_gle_currency: if account: - account_currency = frappe.get_cached_value("Account", account, "account_currency", cache=True) + account_currency = frappe.get_cached_value("Account", account, "account_currency") if (account and account_currency != existing_gle_currency) or not account: account = get_party_gle_account(party_type, party, company) @@ -402,7 +402,7 @@ def get_party_bank_account(party_type, party): def get_party_account_currency(party_type, party, company): def generator(): party_account = get_party_account(party_type, party, company) - return frappe.get_cached_value("Account", party_account, "account_currency", cache=True) + return frappe.get_cached_value("Account", party_account, "account_currency") return frappe.local_cache("party_account_currency", (party_type, party, company), generator) @@ -474,9 +474,7 @@ def validate_party_accounts(doc): else: companies.append(account.company) - party_account_currency = frappe.get_cached_value( - "Account", account.account, "account_currency", cache=True - ) + party_account_currency = frappe.get_cached_value("Account", account.account, "account_currency") if frappe.db.get_default("Company"): company_default_currency = frappe.get_cached_value( "Company", frappe.db.get_default("Company"), "default_currency"