Odoo 13 as it was anticipated came with a lot of improvements and new features benefiting customers. I am sure via looking into the feature listings and improvements in Odoo 13, everybody shall get lured to migrating to Odoo 13. Odoo 13 sparkles with many gems such as rich user interface, better performance optimizations, efficient tracking, intuitive reporting, analysis matrix and so on. Therefore, irrespective of whether you are an Odoo user or new to Odoo, you should migrate to Odoo 13.
Migrating to Odoo 13 can definitely bring you a good list of cheers in the business. Moreover, Odoo 13 is built upon python 3.6 meetings all the latest advancements in the application.
Talking about Odoo in general, Odoo is considered to be the fastest-growing ERP in the market. Odoo is known for its versatility and logical sequitur. It efficiently manages and meets all kinds of business requirements with its modular architecture. One need not run into complex steps and procedures to get things done. Odoo is simply defined with simplicity.
If you are into the search of how to migrate a module to Odoo 13, this blog presents you the general know-how.
Consider the following changes to be made at the time of migration
1. Firstly, change the version of the module to 220.127.116.11.0
In the version number firstly it should be the main version (13.0) followed by the format x.y.z
Increment ‘x’ when there are major changes in views and data models.
Increment ‘y’ when new features are added without disturbing the actual functionality.
Increment ‘z’ when certain bug fixes are made.
2. No need of decorators such as @api.multi, @api.returns, @api.one, @api.cr, @api.model_cr in the code.By default multi-records are considered.
3. Remove the migration script from the previous version code if any.
4. Assign a value to the non stored computed fields even if the value is “False” in the ‘compute’ method.
5. The use of sudo(user) is deprecated in version 13 instead, with_user(user) can be used.
6. The FA(Font Awesome) icons have changed in their names, so you have to change it in your code.
Example: address-book-o to address-book,area-chart to chart-area, etc.
7. In version 12 we have ‘old_name’ attribute in the code, remove this ‘old_name’ attribute from the code.
8. Remove the view_type from XML definition. Now by default, it’s form view.
Remove ‘multi’ from ‘ir.actions.act_window’ instead use ‘binding_view_types’ to indicate the view type(list,form).
Example: <field name="binding_view_types">list</field>
If using <act_window> tag use ‘binding_views’. Example binding_views="form".
9. Add the tests in the module in order to improve code coverage.
10. In case of decimal precision for float fields like import odoo.addons.decimal_precision as dp;
x = fields.Float(digits=dp.get_precision("Product Unit of Measure")))
Now you can use it without importing the decimal_precision
x = fields.Float(digits="Product Unit of Measure")
11. In case of accounting module note the following changes:
> account_invoice -> account.move
> account.invoice.line -> account.move.line
> account.invoice.tax -> account.tax
In case of views note the following changes:
> account.invoice_form -> account.view_move_form
> account.invoice_supplier_form -> account.view_move_form
12. Understand the functionality of the module in the previous version and make sure it serves this functionality in the migrated version of the module too.
Run this command in the terminal to see what is to removed/changed:
grep -nri 'oldname\|sudo([^\)]\+)\|api.multi\|api.returns\|api.one\|api.cr\|api.model_cr\|12.0\|compute=' $MODULE
You can refer our previous blogs on how to to create, duplicate, delete, backup, and restore a database from Odoo 13 Database Management