Until now invoice_id is filled on the transaction only when we make payments through invoice. However if we make payments through sale order then invoice_id is not filled. This commit fixes that issue. As there is no common point between sale_payment and account_payment except payment, a void method is added in payment and an override done in account_payment. That was when both modules are installed code is correctly triggered. This commit is related to task ID 1813602. Closes #22746 .