fix: Fiter passing fix in get batch query (#18130)
This commit is contained in:
@@ -297,7 +297,6 @@ def get_batch_no(doctype, txt, searchfield, start, page_len, filters):
|
|||||||
order by batch.expiry_date, sle.batch_no desc
|
order by batch.expiry_date, sle.batch_no desc
|
||||||
limit %(start)s, %(page_len)s""".format(cond, match_conditions=get_match_cond(doctype)), args)
|
limit %(start)s, %(page_len)s""".format(cond, match_conditions=get_match_cond(doctype)), args)
|
||||||
|
|
||||||
if batch_nos:
|
|
||||||
return batch_nos
|
return batch_nos
|
||||||
else:
|
else:
|
||||||
return frappe.db.sql("""select name, concat('MFG-', manufacturing_date), concat('EXP-',expiry_date) from `tabBatch` batch
|
return frappe.db.sql("""select name, concat('MFG-', manufacturing_date), concat('EXP-',expiry_date) from `tabBatch` batch
|
||||||
|
|||||||
@@ -240,14 +240,6 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
get_batch_fields: function() {
|
get_batch_fields: function() {
|
||||||
var me = this;
|
var me = this;
|
||||||
|
|
||||||
let filters = {
|
|
||||||
item_code: me.item_code
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.warehouse || me.warehouse_details.name) {
|
|
||||||
filters['warehouse'] = me.warehouse || me.warehouse_details.name;
|
|
||||||
}
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
{ fieldtype: 'Section Break', label: __('Batches') },
|
{ fieldtype: 'Section Break', label: __('Batches') },
|
||||||
{
|
{
|
||||||
@@ -262,7 +254,10 @@ erpnext.SerialNoBatchSelector = Class.extend({
|
|||||||
'in_list_view': 1,
|
'in_list_view': 1,
|
||||||
get_query: function () {
|
get_query: function () {
|
||||||
return {
|
return {
|
||||||
filters: filters,
|
filters: {
|
||||||
|
item_code: me.item_code,
|
||||||
|
warehouse: me.warehouse || me.warehouse_details.name
|
||||||
|
},
|
||||||
query: 'erpnext.controllers.queries.get_batch_no'
|
query: 'erpnext.controllers.queries.get_batch_no'
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user