Cannot delete Stock Entry

Hello,

we have created a Stock Entry from the Production Order as a test, but we cannot delete it anymore.
Therefore we also cannot delete the Production Order and related Sales Order.

When trying to delete the Stock Entry, we get the below error.
Could anybody help us? Thank you and best regards
Giorgio Vergano

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 45, in cancel
doc.cancel()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 836, in cancel
self._cancel()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 826, in _cancel
self.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in run_post_save_methods
self.run_method(“on_cancel”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 76, in on_cancel
self.update_production_order()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 491, in update_production_order
pro_doc.run_method(“update_status”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 148, in update_status
self.update_required_items()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 428, in update_required_items
self.update_transaferred_qty_for_required_items()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 492, in update_transaferred_qty_for_required_items
d.db_set(‘transferred_qty’, transferred_qty, update_modified = False)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 957, in db_set
self.modified, self.modified_by, update_modified=update_modified)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 674, in set_value
values, debug=debug)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 166, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1018, in _read_packet
packet.check_error()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 107, in raise_mysql_exception
raise errorclass(errno, errval)
IntegrityError: (1048, u"Column ‘transferred_qty’ cannot be null")

Traceback (most recent call last):
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/app.py”, line 62, in application
response = frappe.handler.handle()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 22, in handle
data = execute_cmd(cmd)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/handler.py”, line 53, in execute_cmd
return frappe.call(method, **frappe.form_dict)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/init.py”, line 939, in call
return fn(*args, **newargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/desk/form/save.py”, line 45, in cancel
doc.cancel()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 836, in cancel
self._cancel()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 826, in _cancel
self.save()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 256, in save
return self._save(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 307, in _save
self.run_post_save_methods()
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 892, in run_post_save_methods
self.run_method(“on_cancel”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 76, in on_cancel
self.update_production_order()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/stock/doctype/stock_entry/stock_entry.py”, line 491, in update_production_order
pro_doc.run_method(“update_status”)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 755, in run_method
out = Document.hook(fn)(self, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1024, in composer
return composed(self, method, *args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 1007, in runner
add_to_return_value(self, fn(self, *args, **kwargs))
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 749, in
fn = lambda self, *args, **kwargs: getattr(self, method)(*args, **kwargs)
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 148, in update_status
self.update_required_items()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 428, in update_required_items
self.update_transaferred_qty_for_required_items()
File “/home/ubuntu/frappe-bench/apps/erpnext/erpnext/manufacturing/doctype/production_order/production_order.py”, line 492, in update_transaferred_qty_for_required_items
d.db_set(‘transferred_qty’, transferred_qty, update_modified = False)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/model/document.py”, line 957, in db_set
self.modified, self.modified_by, update_modified=update_modified)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 674, in set_value
values, debug=debug)
File “/home/ubuntu/frappe-bench/apps/frappe/frappe/database.py”, line 166, in sql
self._cursor.execute(query, values)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 165, in execute
result = self._query(query)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/cursors.py”, line 321, in _query
conn.query(q)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 860, in query
self._affected_rows = self._read_query_result(unbuffered=unbuffered)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1061, in _read_query_result
result.read()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1349, in read
first_packet = self.connection._read_packet()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 1018, in _read_packet
packet.check_error()
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/connections.py”, line 384, in check_error
err.raise_mysql_exception(self._data)
File “/home/ubuntu/frappe-bench/env/local/lib/python2.7/site-packages/pymysql/err.py”, line 107, in raise_mysql_exception
raise errorclass(errno, errval)
IntegrityError: (1048, u"Column ‘transferred_qty’ cannot be null")