Invoice line state is cancelled when it was credited with refund
Since 22eabf722a91 the invoice state is cancelled when it has been refund by credit.
But for example the Move.invoiced_quantity
does not count cancelled invoice line as invoiced. But it is wrong for a refund invoice because it has been invoiced but just refund (idem for cancelling with just a cancel move). Idem for the actual quantity which ignored cancelled lines.
Also a refund invoice should not set the sale in invoice exception because it has been accounted and if the refund was a mistake, the refund can be re-refund.
So for me the invoice state of the line should not be cancelled when the invoice is cancelled but with a cancel move. And order should not be in invoice exception if the invoice is cancelled with a cancel move.