Warranty Claim - Serial Number Listing should not require Warehouse to not be assigned

For warranty claims I personally think that it should not be required for Serial Numbers to not be assigned to a Warehouse. Example, if a customer returns a good with a serial number we most likely will do a material transfer to a warehouse for faulty goods. This allows us to track the particular serial number better.

I suggest in erpnext/warranty_claim.js at develop · frappe/erpnext · GitHub

That we change from:

cur_frm.fields_dict['serial_no'].get_query = function(doc, cdt, cdn) {
	var cond = [];
	var filter = [
		['Serial No', 'docstatus', '!=', 2],
		['Serial No', 'warehouse', '=', ""]
	];
	if(doc.item_code) {
		cond = ['Serial No', 'item_code', '=', doc.item_code];
		filter.push(cond);
	}
	if(doc.customer) {
		cond = ['Serial No', 'customer', '=', doc.customer];
		filter.push(cond);
	}
	return{
		filters:filter
	}
}

to:

cur_frm.fields_dict['serial_no'].get_query = function(doc, cdt, cdn) {
	var cond = [];
	var filter = [
		['Serial No', 'docstatus', '!=', 2]
	];
	if(doc.item_code) {
		cond = ['Serial No', 'item_code', '=', doc.item_code];
		filter.push(cond);
	}
	if(doc.customer) {
		cond = ['Serial No', 'customer', '=', doc.customer];
		filter.push(cond);
	}
	return{
		filters:filter
	}
}

Basically just remove the Warehouse check

@bohlian Better place to discuss this would be a pull request :slight_smile:

@bohlian can you send a PR

Was a little caught up earlier.

Here is the PR. Thanks.

1 Like