Unknown column name error in erpnext

In purchase receipt module this error occur.
pymysql.err.InternalError: (1054, “Unknown column ‘item_bin’ in ‘field list’”)
There is no field in the doctype and child doctype but this error shows…

Another problem is in the child doctype when i enter the item code its shows the error.
Wrong fieldname item_bin in add_fetch configuration of custom script

So i found where the error is occur. But i didn’t find the solution.

Can you share the whole error log?

@Nasir_Khan

Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 273, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in _save
self.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 224, in insert
self._validate_links()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 759, in _validate_links
result = d.get_invalid_links(is_submittable=self.meta.is_submittable)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 486, in get_invalid_links
values_to_fetch, as_dict=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 401, in get_value
order_by, cache=cache)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 445, in get_values
out = self._get_values_from_table(fields, filters, doctype, as_dict, debug, order_by, update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 592, in _get_values_from_table
as_dict=as_dict, debug=debug, update=update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 156, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/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/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘item_bin’ in ‘field list’”)

request.js:355 Traceback (most recent call last):
File “/home/frappe/frappe-bench/apps/frappe/frappe/app.py”, line 64, in application
response = frappe.api.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/api.py”, line 59, in handle
return frappe.handler.handle()
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 24, in handle
data = execute_cmd(cmd)
File “/home/frappe/frappe-bench/apps/frappe/frappe/handler.py”, line 64, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/frappe/frappe-bench/apps/frappe/frappe/init.py”, line 1064, in call
return fn(*args, **newargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 21, in savedocs
doc.save()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 273, in save
return self._save(*args, **kwargs)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 296, in _save
self.insert()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 224, in insert
self._validate_links()
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/document.py”, line 759, in _validate_links
result = d.get_invalid_links(is_submittable=self.meta.is_submittable)
File “/home/frappe/frappe-bench/apps/frappe/frappe/model/base_document.py”, line 486, in get_invalid_links
values_to_fetch, as_dict=True)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 401, in get_value
order_by, cache=cache)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 445, in get_values
out = self._get_values_from_table(fields, filters, doctype, as_dict, debug, order_by, update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 592, in _get_values_from_table
as_dict=as_dict, debug=debug, update=update)
File “/home/frappe/frappe-bench/apps/frappe/frappe/database/database.py”, line 156, in sql
self._cursor.execute(query, values)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 170, in execute
result = self._query(query)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/cursors.py”, line 328, in _query
conn.query(q)
File “/home/frappe/frappe-bench/env/lib/python3.6/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/python3.6/site-packages/pymysql/connections.py”, line 732, in _read_query_result
result.read()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 1075, in read
first_packet = self.connection._read_packet()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/connections.py”, line 684, in _read_packet
packet.check_error()
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/protocol.py”, line 220, in check_error
err.raise_mysql_exception(self._data)
File “/home/frappe/frappe-bench/env/lib/python3.6/site-packages/pymysql/err.py”, line 109, in raise_mysql_exception
raise errorclass(errno, errval)
pymysql.err.InternalError: (1054, “Unknown column ‘item_bin’ in ‘field list’”)

Have you customized the Purchase Receipt Item DocType?
It seems like you have added a field in the Purchase Receipt Item and added the value ‘item_bin’ in the fetch from field. This issue can be simply resolve by removing the value ‘item_bin’ from the fetch from field in the DocType or Customized form of Purchase Receipt Item.

Remove item.item_bin, as shown in the image.

@Nasir_Khan Thank u bro…