Ir al contenido
Menú
Se marcó esta pregunta
1 Responder
133 Vistas

Dear Odoo Community Members,


I am reaching out to seek your support and expertise regarding a migration project we are currently undertaking within our Odoo v18 environment.


We have recently migrated our database from an older version to Odoo v18. Previously, we had a custom field to select "Branches" across various relevant records (sales, invoices, etc.). With the new functionality to have actual `res.company` records as branches, we are planning to implement these old "Custom Branches" into Odoo-supported branches.


The primary challenge is that our client requests the migration of all historical data from the old "Custom Branches" to the newly created `res.company` records. We are developing a server-side action that will run as a scheduled action to migrate the `company_id` field from the old company ID (1) to the new branch company ID (4).


Additionally, it is crucial to consider that accounting records do not exist in isolation; they have related records such as payments and partial reconciliations. We need to ensure that all these related records are correctly updated to reflect the new company structure.


To ensure the success of this migration, we would greatly appreciate any information regarding:


- Success Stories and Case Studies: Examples of similar migrations that have been successfully executed, including the challenges faced and the solutions implemented.


- Technical Best Practices: Guidance on the most effective methods to perform this migration, including the recommended sequence for migrating different types of records and strategies for handling dependencies between them.


- Potential Pitfalls and Mitigation Strategies: Insights into common issues encountered during similar migrations and how to proactively address them.


- Tool Recommendations: Any Odoo-native or third-party tools that could facilitate or streamline the migration process.


Our goal is to execute this migration with minimal disruption to our operations and maximum data accuracy. We appreciate any support or resources you can share.


Avatar
Descartar
Mejor respuesta

Migration Approach

  1. Plan & Map Branches
    • Map old “Custom Branch” values → new res.company records.
  2. Migrate Core Records First
    • Update company_id on sales orders, invoices, purchase orders.
    • Use a server-side action or script to run in batches.
  3. Handle Related Records
    • Payments, reconciliations, stock moves, journal entries → update company_id consistently.
    • Ensure accounting dependencies are respected (partial reconciliations, journal constraints).
  4. Sequence Matters
    • Update parent records first (e.g., invoices) → then related child records (payments, moves).
  5. Test in a Staging Database
    • Validate accounting, reports, and workflows before running in production.
  6. Tools & Best Practices
    • Odoo Studio / Server Actions for automation.
    • XML-RPC scripts or custom migration module for large datasets.
    • Always backup the database before migration.
  7. Pitfalls to Avoid
    • Inconsistent company_id across related records → breaks accounting constraints.
    • Forgetting reconciliations → causes reporting errors.
    • Skipping testing → can disrupt operations.

Avatar
Descartar
Publicaciones relacionadas Respuestas Vistas Actividad
2
may 25
750
0
ago 25
172
1
ago 25
882
2
jul 25
368
1
jul 25
859