Modifying Pick List Picking Rules

Hi, I’m trying to modified Pick List’s picking logic.

First of all, I’ve added customized field named Status in Batch and we want to use that field as picking logic.
What I’m trying to do is modifying picking logic into this.

  1. If the Material Request Number Started with ‘SKU’, it suggesting to pick material with batch status 'Released"
  2. If the Materla Request Number Started with ‘NONSKU’, it can pick all batch and ignoring the batch status.

I already try modifying 3 file, queries.py ,picklisy.py and piclist.js and still not working. Did I missing something?

here is the code that i add/modified

queries.py

def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
cond1 = “”
cond2 = “”

if filters.get("materials"):
	cond1 = "and batch.status='Released' "

if filters.get("posting_date"):
	cond2 = "and (batch.expiry_date is null or batch.expiry_date >= %(posting_date)s) "

batch_nos = None
args = {
	'item_code': filters.get("item_code"),
	'warehouse': filters.get("warehouse"),
	'posting_date': filters.get('posting_date'),
	'txt': "%{0}%".format(txt),
	"start": start,
	"page_len": page_len

pick_list.py

idef get_available_item_locations(item_code, from_warehouses, required_qty, company, material_request):
locations = []
frappe.msgprint(
msg=“im here”,
title=‘Logs’
)

if frappe.get_cached_value('Item', item_code, 'has_serial_no'):
	locations = get_available_item_locations_for_serialized_item(item_code, from_warehouses, required_qty, company)
elif frappe.get_cached_value('Item', item_code, 'has_batch_no'):
	frappe.msgprint(
		msg="im here",
		title='Logs'
	)
	if material_request.find('NONSKU') != -1:
		locations = get_available_item_locations_for_batched_item(item_code, from_warehouses, required_qty, company)
	else:
		locations = get_available_item_locations_for_batched_item_sku(item_code, from_warehouses, required_qty, company)
	
else:
	locations = get_available_item_locations_for_other_item(item_code, from_warehouses, required_qty, company)

total_qty_available = sum(location.get('qty') for location in locations)

remaining_qty = required_qty - total_qty_available

if remaining_qty > 0:
	frappe.msgprint(_('{0} units of {1} is not available.')
		.format(remaining_qty, frappe.get_desk_link('Item', item_code)))

return locations

pick_list.js

		if(row.material_request.includes('NONSKU')){
			return {
				query: 'erpnext.controllers.queries.get_batch_no',
				filters: {
					item_code: row.item_code,
					warehouse: row.warehouse
				},
			};
		}else{
			return {
				query: 'erpnext.controllers.queries.get_batch_no',
				filters: {
					item_code: row.item_code,
					warehouse: row.warehouse,
					materials: 'Released'
				},
			};
		}