Stock Entry Cancellation Bug for Serialized Items

After a serialized item is delivered to a customer, cancellation of Stock Entry which was done previously is possible. But this shouldn’t be allowed as the item is not available with us. After canceling the Stock Entry, the serial number (initially with empty warehouse as it got delivered) has warehouse assigned and is further allowing all the operations like repacking or material transfer.

Steps to replicate:

  1. Create a Stock Entry Repack for a serialized item. Say serial number is S001 and entry id is STE-00001 and it is in a warehouse Stores
  2. Create a Delivery Note by putting that serial number S001
  3. Check Warehouse in Serial No List and it will be empty as it got delivered.
  4. Cancel STE-00001. (This is allowing but shouldn’t allow)
  5. Check Warehouse again in Serial No List and it shows Stores
  6. Now, we can do further operations on this serial no which physically doesn’t exist with us.

What should be done (as per my knowledge):
Once, the serialized item is delivered, do not allow cancellation of the previous Stock Entries.

1 Like

Issue raised in github.

https://github.com/frappe/erpnext/issues/15553

Let me know if this is a valid issue. Kindly come up with a use case if my point is invalid.