We noticed a strange behavior with sale amendment. Sometimes, when a user is doing a sale amendment, shipment related to the sale is duplicated.
To solve the problem, we have to delete the first shipment linked to the sale.
This is not happening every time. There’s no error, except there are two shipments instead of one for the sale.
For me it is not comprehensive how the sale could create a new shipment if the previous outgoing moves are not deleted.
So I could understand that something prevent to delete the outgoing moves but then the processing of the sale should not create new moves.
I retried to do the same amendment on the same sale on a cloned database and I cannot reproduce the behavior.
When deleting shipment in sale amendment, shipment is first cancelled and there is a decorator to process sale when doing a cancel on shipment out, so there’s a first call to sale process and then in the sale amendment after the clear_sale method, there’s another call to sale process. Maybe this could lead to duplicate shipments ?