fix: Ambigous column in picklist query
This commit is contained in:
parent
385830bb51
commit
517fbf1d1f
@ -9,6 +9,7 @@ from frappe import _
|
||||
from frappe.model.document import Document
|
||||
from frappe.model.mapper import map_child_doc
|
||||
from frappe.utils import cint, floor, flt, today
|
||||
from six import iteritems
|
||||
|
||||
from erpnext.selling.doctype.sales_order.sales_order import (
|
||||
make_delivery_note as create_delivery_note_from_sales_order,
|
||||
@ -245,7 +246,7 @@ def get_available_item_locations_for_serialized_item(item_code, from_warehouses,
|
||||
warehouse_serial_nos_map.setdefault(warehouse, []).append(serial_no)
|
||||
|
||||
locations = []
|
||||
for warehouse, serial_nos in warehouse_serial_nos_map.items():
|
||||
for warehouse, serial_nos in iteritems(warehouse_serial_nos_map):
|
||||
locations.append({
|
||||
'qty': len(serial_nos),
|
||||
'warehouse': warehouse,
|
||||
@ -272,9 +273,9 @@ def get_available_item_locations_for_batched_item(item_code, from_warehouses, re
|
||||
and IFNULL(batch.`expiry_date`, '2200-01-01') > %(today)s
|
||||
{warehouse_condition}
|
||||
GROUP BY
|
||||
`warehouse`,
|
||||
`batch_no`,
|
||||
`item_code`
|
||||
sle.`warehouse`,
|
||||
sle.`batch_no`,
|
||||
sle.`item_code`
|
||||
HAVING `qty` > 0
|
||||
ORDER BY IFNULL(batch.`expiry_date`, '2200-01-01'), batch.`creation`
|
||||
""".format(warehouse_condition=warehouse_condition), { #nosec
|
||||
|
Loading…
x
Reference in New Issue
Block a user