Activate the multi-company feature in Odoo. You can do this in Settings > Users & Companies > Companies.
Go to Settings > Technical > Sequences & Identifiers > Sequences. If you cannot view it, then you need to enable the developer mode.
Find the sequence you would like to modify - for example, the invoice sequence.
If you want to create a new sequence click the Create button.
Set the Name to something descriptive - for example, "Shared Invoice Sequence".
Change the Prefix to the format you want - for example INV/2024/.
Set the Padding to how many digits you want - for example, 5 for 00001.
Sequence Scope:
At the sequence configuration, if this sequence is global, then the Company field should be set to All Companies
To access invoicing settings, go to Invoicing > Configuration > Settings.
In settings, the invoice numbering should be set to take the newly created or modified sequence.
Repeat similar steps for the sequences of payments:
Go to Settings > Technical > Sequences & Identifiers > Sequences.
Create anew or edit a payment sequence and make sure that it is set on All Companies.