[Help] Wrong journal assignment: 400 journal entries posted to the wrong company's journals (Multi-company setup)
Hi everyone,
I'm facing a tricky accounting issue on Odoo and could really use your insights or workarounds.
The Context: We recently set up a new branch (multi-company environment) in our DB. During this process, two new accounting journals were automatically created for this new entity.
The Problem: By mistake, these two new journals were used to log transactions belonging to the main company. As a result, we now have about 400 journal entries posted in the wrong journals (the ones belonging to the new branch).
As you know, Odoo restricts changing the journal on a journal entry once it has been validated (and even in draft mode, changing the journal on an existing move via the UI can be a nightmare or outright blocked depending on the version).
What I need to do: Cleanly move/transfer these 400 entries from the new journals back to their original, correct journals in the main company.
My Questions:
- Is there a native, Odoo-standard trick (without coding) to mass-reassign or transfer these entries?
- If I have to use a Server Action (Python script), what is the safest way to update the
journal_idonaccount.moveandaccount.move.linewithout breaking sequences or account constraints? - Is it better to reset the entries to Draft, update the journal via script, and post them again? If so, how will this affect the naming/sequencing?
- Or is it safer to just cancel/reverse them all, and re-import them into the correct journals, even if handling 400 entries this way is a bit tedious?
I am an Odoo integrator, so I'm comfortable with technical solutions (scripts, server actions), but I'm looking for the absolute best practice to avoid messing up the accounting integrity and sequences.
Thanks in advance for your help!
Sébastien