txt.si/blog

Odoo upgrade notes

Lately I was upgrading my old Odoo 8 deploy to something more recent. We are using only the basic accounting functionality, mostly invoicing. Unfortunately Odoo is moving away from OSS, but I think that (potential) future migration to ERPNext or something like that will be a bit easier, if we are running a supported Odoo version. Because of that Odoo direction, there are no official open upgrade path between mayor Odoo versions, but fortunately there is OCA/OpenUpgrade project.

Even with this project, the upgrades are not seamless and require manual fixes down the line. What follows is a set of notes I took when updating from Odoo 8 to Odoo 12.

General Upgrade notes

  1. Determine what Odoo Version are you running, make a DB backup.
  2. Checkout the next major version from OCA/OpenUpgrade.
    • You need to upgrade version by version, without skipping
    • OCA Docs advise to have a separate checkout for each version, to avoid any issues with the stale .pyc versions when switching branches
  3. Install virtualenv with the correct Python version in the checked out directory (Python2 up to Odoo 11, Python3 for Odoo 11+)
  4. Install dependencies in requirements.txt
  5. Run the “regular” Odoo start command with added –update all –stop-after-init flags and wait for it to finish
    • ./odoo-bin –database=dbname –addons-path=addons –update all –stop-after-init
    • Start command is odoo.py for versions up to 10, for 10+ it’s odoo-bin
  6. If there are no critical errors in the log, you can install regular Odoo version that you just migrated to, and test it/do cleanup.
    • You have to use the regular Odoo version for this, as the OpenUpgrade version is not meant to be run beyond migration
  7. Check OCA OpenUpgrade docs for informations on what happened with your modules.
  8. Rinse and repeat in a fresh virtualenv for the next version.

Specific manual fixes

Odoo 10 - Product details screen error

If there is an error when trying to see a product/line item of an invoice, then you have to delete some stale Views

  1. Go to Settings and activate Developer Mode
  2. Under Views search for product.template.common.form.inherit and delete this View.

Odoo 11 - Unit of Measure upgrade error

When trying to update to Odoo 12, you get an error stating that there are more reference units for a given UOM Category.

  1. Go to Sales -> Products and open Unit of Measure
  2. Go thorough all UoMs and set them so that each category has only one reference unit. Setting them to Not Active works too

Odoo 11 - Bank Account holder missing

As with previous error, OCA OpenUpgrade catches this when trying to upgrade to Odoo 12. It complains that there is no Account Holder for a specific Bank Account.

  1. Go to Invoicing -> Configuration -> Bank Account
  2. Check that each Bank Account account has a account holder (you select a bank account, then Edit Bank Account and there check for account holder)

Odoo 12 - Invoices are missing assets/not getting their styles applied

If your invoices look unstyled and preview shows errors about missing assets, there are probably some stale assets in Views

  1. Go to Settings and activate Developer Mode
  2. Go to Views and search for report_assets_common and check (and probably delete) all inherited views