mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-15 15:38:39 +00:00
fix(stock): tie-break pick-list lookup in update_packed_item_with_pick_list_info
The Pick List Item get_value orders only by qty desc; a pick list can hold multiple rows for the same SO item split across warehouses/batches/serials that tie on qty, so MariaDB and Postgres could stamp a different warehouse/batch/serial onto the packed item. Add a name tiebreaker. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -326,7 +326,8 @@ def update_packed_item_with_pick_list_info(main_item_row, pi_row):
|
||||
},
|
||||
["warehouse", "batch_no", "serial_no"],
|
||||
as_dict=True,
|
||||
order_by="qty desc",
|
||||
# name tiebreaker: split pick-list rows can tie on qty -> pick the same warehouse/batch/serial on both engines
|
||||
order_by="qty desc, name asc",
|
||||
)
|
||||
|
||||
if not pl_row:
|
||||
|
||||
Reference in New Issue
Block a user