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: decimal issue in pick list (backport #41972) #41982

Merged
Merged
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
6 changes: 4 additions & 2 deletions erpnext/stock/doctype/pick_list/pick_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ def get_items_with_location_and_quantity(item_doc, item_location_map, docstatus)
# if stock qty is zero on submitted entry, show positive remaining qty to recalculate in case of restock.
remaining_stock_qty = item_doc.qty if (docstatus == 1 and item_doc.stock_qty == 0) else item_doc.stock_qty

while flt(remaining_stock_qty) > 0 and available_locations:
precision = frappe.get_precision("Pick List Item", "qty")
while flt(remaining_stock_qty, precision) > 0 and available_locations:
item_location = available_locations.pop(0)
item_location = frappe._dict(item_location)

Expand Down Expand Up @@ -838,6 +839,7 @@ def validate_picked_materials(item_code, required_qty, locations, picked_item_de

def filter_locations_by_picked_materials(locations, picked_item_details) -> list[dict]:
filterd_locations = []
precision = frappe.get_precision("Pick List Item", "qty")
for row in locations:
key = row.warehouse
if row.batch_no:
Expand All @@ -856,7 +858,7 @@ def filter_locations_by_picked_materials(locations, picked_item_details) -> list
if row.serial_nos:
row.serial_nos = list(set(row.serial_nos) - set(picked_item_details[key].get("serial_no")))

if row.qty > 0:
if flt(row.qty, precision) > 0:
filterd_locations.append(row)

return filterd_locations
Expand Down
Loading