Delivery button still highlighted after delivery note was made from the invoice

When workflow goes from sales orders to sales invoice to delivery note, after delivery note is created from sales invoice, the delivery note is not linked with the sales invoice and the delivery button is still blue from sales invoice. It causes error when create Credit Note from sales invoice and check update stock.