Bug 10869 and Bug 10758 try to deal with the fallout from deleting a record with an order attached. I think, rather than fixing the order end we should prevent the deletion of the record in the first place to avoid causing an issue. This case also affects EDI ordering as item cannot be received when a title has been deleted
Nick, There is already a big warning when you try to delete a record used in orders. I do not understand why we should block the user to do it.
(In reply to Jonathan Druart from comment #1) > Nick, > There is already a big warning when you try to delete a record used in > orders. > I do not understand why we should block the user to do it. Hmm...yes you do get a big warning, I guess I still find it bothersome that the user can't fix it once they have made this decision, maybe instead of preventing delete we should add a method for reattaching the order to a record? Also, if you 'Delete items in a batch' and choose 'Delete record if no items remain' you do not receive the warning
Does it warn on the cataloguing side too? I have had libraries deleting records who are 'on order' by accident a few times - you will need SQL then to clean it up.
I don't think a warning is enough. We should block users from deleting records with open orders attached because it creates a situation where manual changes to the database must be done to repair orders where the record has been deleted. Consider that a library may have multiple divisions, where one librarian is "cleaning up" records by deleting them, and the other is ordering items and keeps finding his or her on order records are suddenly deleted. Depending on the size of the library system, it could take the librarian quite a while to find out why those records are suddenly gone. (In reply to Jonathan Druart from comment #1) > Nick, > There is already a big warning when you try to delete a record used in > orders. > I do not understand why we should block the user to do it.
Perhaps we need a new user permission or system preference to prevent deletion of records with open orders on them.
I think it's ok to block users from deleting and ask them to cancel the orders first. Maybe with a link to the order in acq if they have the right permission? Separate problem, but related to deleting the records: Once you deleted the record the cancelled order remains visible, but has no title anymore. That's not helpful and we can't delete cancelled orders either. The whole topic of how to handle deletes is something we should tackle.
*** This bug has been marked as a duplicate of bug 27893 ***
Marking this as a duplicate of a newer bug as the newer bug has a little work on it already.