feat: Use controller for serial no. API

This commit is contained in:
scmmishra 2019-04-16 15:57:51 +05:30
parent 61d6b677e4
commit eee5c38911

View File

@ -462,15 +462,5 @@ def get_delivery_note_serial_no(item_code, qty, delivery_note):
@frappe.whitelist()
def auto_fetch_serial_number(qty, item_code, warehouse):
serial_numbers = frappe.db.sql_list("""select name from `tabSerial No`
where
item_code = %(item_code)s
and warehouse = %(warehouse)s
and delivery_document_no is null
and sales_invoice is null
limit {0}""".format(cint(qty)), {
'item_code': item_code,
'warehouse': warehouse
})
serial_numbers = frappe.get_list("Serial No", filters={"item_code": item_code, "warehouse": warehouse, "delivery_document_no": "", "sales_invoice": ""}, limit=qty, order_by="creation")
return serial_numbers