To my knowledge, for the sale order number, there is the field source_document in account.move.line that you can show in the form view or in the report. Regarding the delivery number, it is more complex; because from the account.move.line you need to go to the sale.order.line and from the there you need to get the stock.move and then get the field "reference" of each line. I am not a developer, but as far as I know you need to write more loops to get the list of the stock moves.
where do you want to add them? in the backend form view or do you mean on the invoice report?
could be good if i could add it to backend form view. I want to show it in my invoice report (print)