Unable to pick my warehouse from the list while making delivery note

Hi,

I have an item A in a warehouse called Warehouse 80. But item A has 2 batches so I have 2 batches of this item in the same warehouse. Now when I open the item’s profile, I see Warehouse 80 two times and when I am making a delivery note and I want to search the warehouse so I can select the batch I get the error below.

Please help anyone.

Thank you.

Traceback (most recent call last):
  File "/home/frappe/frappe-bench/apps/frappe/frappe/app.py", line 61, in application
    response = frappe.handler.handle()
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 21, in handle
    data = execute_cmd(cmd)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/handler.py", line 56, in execute_cmd
    return frappe.call(method, **frappe.form_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1036, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py", line 53, in search_link
    search_widget(doctype, txt, query, searchfield=searchfield, page_length=page_length, filters=filters, reference_doctype=reference_doctype, ignore_user_permissions=ignore_user_permissions)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/desk/search.py", line 78, in search_widget
    searchfield, start, page_length, filters, as_dict=as_dict)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/__init__.py", line 1036, in call
    return fn(*args, **newargs)
  File "/home/frappe/frappe-bench/apps/erpnext/erpnext/controllers/queries.py", line 418, in warehouse_query
    return frappe.db.sql(query)
  File "/home/frappe/frappe-bench/apps/frappe/frappe/database.py", line 214, in sql
    self._cursor.execute(query)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 170, in execute
    result = self._query(query)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/cursors.py", line 328, in _query
    conn.query(q)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 517, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 732, in _read_query_result
    result.read()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1082, in read
    self._read_result_packet(first_packet)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1152, in _read_result_packet
    self._read_rowdata_packet()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 1186, in _read_rowdata_packet
    packet = self.connection._read_packet()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/connections.py", line 684, in _read_packet
    packet.check_error()
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/protocol.py", line 220, in check_error
    err.raise_mysql_exception(self._data)
  File "/home/frappe/frappe-bench/env/lib/python2.7/site-packages/pymysql/err.py", line 109, in raise_mysql_exception
    raise errorclass(errno, errval)
InternalError: (1242, u'Subquery returns more than 1 row')