Bug at PRODUCT BUNDLE with Batch Number, when Choose Expire Date at DELIVERY NOTE

Dear all,

I found a bug at DELIVERY NOTE when choose BATCH NUMBER of Expired Date.

These are the case:

  1. I have created Product Bundle with Batch Number of Expire Date. Then I want to make delivery note for this bundle of product.

    .
    .
  2. Choose the Batch Number of Expire Date

    .
    .
  3. After choose the Batch Number of Expire Date, then Server Error appear and I can not continue the process

    .
    .
    .
    I see from LOGS something like this:

[ERROR] 2019-11-09 15:00:45,158 | /home/frappe/frappe-bench/apps/frappe/frappe/app.py:
Site: lsa.sit.web.id
Form Dict: {
“batch_no”: “Trial ED BOM BUNDLE 30-11-2019”,
“cmd”: “erpnext.stock.get_item_details.get_batch_qty_and_serial_no”,
“has_serial_no”: “0”,
“item_code”: “Trial ED BOM BUNDLE”,
“warehouse”: “Stores - LTA”
}
Request Error
Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 60, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 55, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 61, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1038, in call
return fn(*args, **newargs)
TypeError: get_batch_qty_and_serial_no() missing 1 required positional argument: ‘stock_qty’

.
.
I see from get_items_details.py , the functions should be follow by stock_qty variable, but maybe stock_qty is not define when call this function:

def get_batch_qty_and_serial_no(batch_no, stock_qty, warehouse, item_code, has_serial_no):
frappe.msgprint(_("TEST"), alert=True)
batch_qty_and_serial_no = {}
batch_qty_and_serial_no.update(get_batch_qty(batch_no, warehouse, item_code))

if (flt(batch_qty_and_serial_no.get('actual_batch_qty')) >= flt(stock_qty)) and has_serial_no:
	args = frappe._dict({"item_code":item_code, "warehouse":warehouse, "stock_qty":stock_qty, "batch_no":batch_no})
	serial_no = get_serial_no(args)
	batch_qty_and_serial_no.update({'serial_no': serial_no})
return batch_qty_and_serial_no

How to solve this error?
Thank you in advance.