I have some modules which expand add-ons of Odoo. For example, models in my_module
which expand crm
:
class Lead(models.Model):
_inherit = 'crm.lead'
# exmaple fields
field_1 = fields.Char(...)
field_2 = fields.Many2one(...)
# ... field 99
class Stage(models.Model):
_inherit = 'crm.stage'
# exmaple fields
field_1 = fields.Char(...)
field_2 = fields.Many2one(...)
# ... field 99
The same situation is for modules which expand hr
, product
, etc.
I need to make some changes to the models. For example, in my_module_1
, I need to change a couple of fields(type, relation), in my_module_2
, just to remove a few fields etc. Of course I also need to change views of each module. And of course I have my custom models which have dependencies with models from different apps/modules. But I have data on production which must be stored.
I did not find any information about migrations(or synchronization of modules) in Odoo.
My question is: What is the best way to update modules/apps on production(if we have many changes in fields of models and views)? Thanks in advance.
Functional Odoo 14. Migration is the process of shifting from one platform to another. It can either be the upgrading of the software platform or the transfer of data from one platform to another. Migration is used in different situations in software platforms.
Import the Chart of Account Once your templates are ready, go to Odoo > List of Records (Chart of accounts) > Click on import > Check the data mapping > Click on test import > then Import.
My question is: What is the best way to update modules/apps on production(if we have many changes in fields of models and views)?
While this question has been around for a while I cannot see any canonical answer therefore here are my two cents.
The problem of migration from one version to another in Odoo is rather common and definitely complicated. With that in mind the OpenUpgrade project has been created. OpenUpgrade is basically an upgrade path
that will help you transform your data and models from version A to version B. For example if a field named fieldA has had its type changed on version 9 and you are on version 8, OpenUpgrade will take care of this by doing the necessary transformations.
OpenUpgrade also gives you the possibility to create your own migration scripts that will do whatever needs to be done in order for your module to be forward ported (or back ported) in various versions. For the standard modules these scripts have already been written to an extend, but for your own you might need to do some writing.
I suggest that you take a look at the documentation above, this is basically your first stop when we talk about migrations in Odoo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With