msupply-foundation / open-msupply

Open mSupply represents our most recent advancement in the Logistics Management Information System (LMIS), expanding on more than two decades of development inherited from the well-established legacy of the original mSupply.
https://msupply.foundation/open-msupply/
Other
23 stars 14 forks source link

Foreign key constraint error when deleting a line from a Delivered Inbound Shipment #5120

Open marthakeezy opened 1 month ago

marthakeezy commented 1 month ago

What went wrong? 😲

Screenshot -> here

Database uploaded here

Expected behaviour 🤔

Error should be user-friendly :)

How to Reproduce 🔨

Steps to reproduce the behaviour:

  1. Create an Outbount Shipment from another store, mark it as Shipped so it will appear as Inbound Shipment in the testing store
  2. Confirm the item as Delivered
  3. Select the item -> click on Actions -> try to remove it from the shipment
  4. See error

Your environment 🌱

lache-melvin commented 1 month ago

Kia ora @marthakeezy - could you share your DB again here for us to investigate? I can't replicate the issue, but we definitely shouldn't be having this kind of error on deleting shipment lines. Wondering if this is somehow related to the shipment-not-transferring issue you had a few days ago...

Setting as high priority to investigate the cause!

marthakeezy commented 1 month ago

Can be found here :)

andreievg commented 1 month ago

deletion shouldn't be allowed on any transfer lines. so even though error seems quite bad, the use case is rare (shouldnt' be possible). proposed fix is to disallow deletion of invoice lines, also need to validate this