We used cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. What For?

« Back to Blogs

Odoo Code Upgrade to 13

Odoo is the most popular and fastest-growing ERP in the market. Every release in Odoo comes up with incredible features and improvements. Specially Odoo13 comes up with lots of improvements like better user interface, better efficiency, and reporting, etc.

Here, if you are using the old version and you want to take advantage of new features then you have to upgrade it to the new version.

While upgrading Odoo you have to consider two scenarios: Code Migration & Database Migration

Before proceeding with data migration, you have to do the code migration. In this blog, you will learn how we can help you to upgrade your module’s code from previous version to Odoo13

You will face some error or traceback after restarting Odoo 13 service with your old version modules. So, You need to take care of the following changes while Odoo code upgrade:

  • Python files:
    1. Version Description:
      1. Change the module version from old to new. Here we are moving odoo12 to odoo13 so we will change the module by specific format
        • (13.0) main Odoo version
        • (1.0.0 - p.q.r) Here p stands for if any change in model or view, q stands for up-gradation, and r stands for bug fixes release
    2. Deprecated Decorators: All the decorators removed like @api.multi, @api.returns, @api.one, @api.cr, and @api.model_cr as they are no longer available in V13. Multi records handled by default now.
      1. You will get a traceback related to the decorator while installing your old module.
        Ex: For @api.multi decorator, you will get below traceback.

        “ AttributeError: module 'odoo.api' has no attribute 'multi' “
    3. Structural Changes in Models: Some models have been changed or merged in the latest version. There are few structural changes detected in the V13 modules like accounting, stock, etc. Therefore this step requires analysis to check compatibility with the migration version to find out the efforts.
    4. Field level changes:
      1. Some of the attributes have been changed/deprecated at the field level like oldname, tracking, etc. If you have the need for those fields, create a migration script, and use openupgradelib's methods.
      2. Check out all "compute" methods of non-computed compute fields that assign values ??to any condition, even if it is a false one.
      3. Don’t rely on any expected default values as the computed stored fields will keep their previous value if not assigned during the calculation method.
  • XML files:
    1. Changes in Views:
      1. As mentioned above, some model’s structure has been changed so its respective views also changed.
      2. View type is deprecated in the latest versions, so there is no need for a view type tag on the action window XML definition. It is by default “form”.
      3. Also, you have to remove some deprecated attributes while declaring views.
    2. There are some changes in FA (Font Awesome) icon names in FA V5 so you have to make the changes accordingly. Make sure all front-end classes have been changed for the Front-end.
      Ex: calendar-check-o to calendar-check
  • Javascript files:
    As per the odoo13 version, some changes also take place in javascript in terms of syntax, elements, and their uses. Please make sure that to address them while doing needed module code upgrade.

At last, Understand the functionality of the module in the previous version and ensure that this functionality also works in the upgraded version of the module. Also, add Automated Tests for better code coverage.

Did you find this blog post helpful? Check out our other blog to know about the features of Odoo V13.

Do you want to upgrade your Odoo to the latest version? Do you want to migrate code and database? Give us a call or email to know more.

contact-us Request a callback WhatsApp