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