When a delivery note is generated from a sales order, the sales order quantity becomes 0.
This :
Was copied from this :
Fixed in the latest version (21.3.63)