diff --git a/erpnext/stock/doctype/pick_list/pick_list.py b/erpnext/stock/doctype/pick_list/pick_list.py index 0e440a1f586..99246774aa1 100644 --- a/erpnext/stock/doctype/pick_list/pick_list.py +++ b/erpnext/stock/doctype/pick_list/pick_list.py @@ -36,7 +36,7 @@ class PickList(Document): for location in self.get("locations"): if ( location.sales_order - and frappe.db.get_value("Sales Order", location.sales_order, "per_picked") == 100 + and frappe.db.get_value("Sales Order", location.sales_order, "per_picked", cache=True) == 100 ): frappe.throw( _("Row #{}: item {} has been picked already.").format(location.idx, location.item_code) @@ -474,7 +474,7 @@ def get_items_with_location_and_quantity(item_doc, item_location_map, docstatus) ) qty = stock_qty / (item_doc.conversion_factor or 1) - uom_must_be_whole_number = frappe.db.get_value("UOM", item_doc.uom, "must_be_whole_number") + uom_must_be_whole_number = frappe.get_cached_value("UOM", item_doc.uom, "must_be_whole_number") if uom_must_be_whole_number: qty = floor(qty) stock_qty = qty * item_doc.conversion_factor