Have an option for sale_amendment to mark open deliveries as "annulled" instead of just deleting them

I have been asked by our office staff if it is possible to mark deliveries that get deleted due to sale amendments automatically as “annulled” instead of just deleting them [and then there being “missing” numbers in the lists of shipments].
So far I just told them if you want that annull the shipment manually first, but I was wondering if there is a reason why open shipments are deleted instead of annulled – and if there would be an issue with changing that (I know for tryton it doesn’t make a differences, but some people like to know why a number is missing/what was cancelled there – “Monk” says “hi” …)

So my idea would’ve been to just mark all open shipments as annulled before _clear_sale is called at some point (not sure where would be best). could there be any issues with that that I am not aware of?

If the shipment is cancelled, it put the sale in exception.
This is because normally the sale and shipment are managed by different group of people so when the stock guys cancel a shipment, the sale guys must know about it and act on it.

ok that makes sense. in our case it is the same people.
so … do you see an issue with me adding some code to mark open shipments as annulled automatically before they would get deleted by the sale_amendment process?

Then the amendment will not recreate anything and you will have the sale in exception state.

yes which is fine and exactly what they want anyway. Thanks then I will just do that.
do you have a recommendation where i would best hook into that?
before validate_amendment maybe?