Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect usage get_cached_value on single doctypes (backport #36434) #36436

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion erpnext/accounts/deferred_revenue.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ def book_deferred_income_or_expense(doc, deferred_process, posting_date=None):
"enable_deferred_revenue" if doc.doctype == "Sales Invoice" else "enable_deferred_expense"
)

accounts_frozen_upto = frappe.get_cached_value("Accounts Settings", "None", "acc_frozen_upto")
accounts_frozen_upto = frappe.db.get_single_value("Accounts Settings", "acc_frozen_upto")

def _book_deferred_revenue_or_expense(
item,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ def validate_with_previous_doc(self):
)

if (
cint(frappe.get_cached_value("Buying Settings", "None", "maintain_same_rate"))
cint(frappe.db.get_single_value("Buying Settings", "maintain_same_rate"))
and not self.is_return
and not self.is_internal_supplier
):
Expand Down
2 changes: 1 addition & 1 deletion erpnext/stock/doctype/price_list/price_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def check_impact_on_shopping_cart(self):

doc_before_save = self.get_doc_before_save()
currency_changed = self.currency != doc_before_save.currency
affects_cart = self.name == frappe.get_cached_value("E Commerce Settings", None, "price_list")
affects_cart = self.name == frappe.db.get_single_value("E Commerce Settings", "price_list")

if currency_changed and affects_cart:
validate_cart_settings()
Expand Down