refactor: rename get_settings -> get_single_value (#47961)

This commit is contained in:
Ankush Menat
2025-06-09 10:10:02 +05:30
committed by GitHub
parent 26abf9f13a
commit 765c7c2bcc
55 changed files with 177 additions and 156 deletions

View File

@@ -38,7 +38,7 @@ class SellingController(StockController):
if self.docstatus == 1 and self.doctype in ["Delivery Note", "Sales Invoice"]:
self.set_onload(
"allow_to_make_qc_after_submission",
frappe.get_settings(
frappe.get_single_value(
"Stock Settings", "allow_to_make_quality_inspection_after_purchase_or_delivery"
),
)
@@ -224,7 +224,7 @@ class SellingController(StockController):
frappe.throw(_("Maximum discount for Item {0} is {1}%").format(d.item_code, discount))
def set_qty_as_per_stock_uom(self):
allow_to_edit_stock_qty = frappe.get_settings(
allow_to_edit_stock_qty = frappe.get_single_value(
"Stock Settings", "allow_to_edit_stock_uom_qty_for_sales"
)
@@ -255,7 +255,7 @@ class SellingController(StockController):
title=_("Invalid Selling Price"),
)
if self.get("is_return") or not frappe.get_settings("Selling Settings", "validate_selling_price"):
if self.get("is_return") or not frappe.get_single_value("Selling Settings", "validate_selling_price"):
return
is_internal_customer = self.get("is_internal_customer")
@@ -715,7 +715,7 @@ class SellingController(StockController):
def validate_for_duplicate_items(self):
check_list, chk_dupl_itm = [], []
if cint(frappe.get_settings("Selling Settings", "allow_multiple_items")):
if cint(frappe.get_single_value("Selling Settings", "allow_multiple_items")):
return
if self.doctype == "Sales Invoice" and self.is_consolidated:
return
@@ -958,7 +958,7 @@ def get_serial_and_batch_bundle(child, parent, delivery_note_child=None):
if child.get("use_serial_batch_fields"):
return
if not frappe.get_settings("Stock Settings", "auto_create_serial_and_batch_bundle_for_outward"):
if not frappe.get_single_value("Stock Settings", "auto_create_serial_and_batch_bundle_for_outward"):
return
item_details = frappe.db.get_value("Item", child.item_code, ["has_serial_no", "has_batch_no"], as_dict=1)