Odoo 11 Development Cookbook(Second Edition)
上QQ阅读APP看书,第一时间看更新

Addon update

When you update an addon, Odoo checks in its list of available addon modules for an installed addon with the given name. It also checks for the reverse dependencies of that addon (these are the addons that depend on the updated addon), and, if any, it will recursively update them.

The update process of a single addon module consists of the following steps:

  1. Run the addon module's premigration steps, if any (refer to Chapter 7, Module Data, for details).
  2. Load the model definitions from the Python source code and update the database structure if necessary (refer to Chapter 5, Application Models, for details).
  3. Load the data files of the addon and update the database contents if necessary (refer to Chapter 7Module Data, for details).
  4. Update the addon's demo data if demo data is enabled in the instance.
  5. If any, run the addon post migration steps (refer to Chapter 7Module Data, for details).
  6. Run a validation of the view definitions of the addon.
  7. If demo data is enabled and test is enabled, run the tests of the addon (refer to Chapter 8, Debugging and Automated Testing, for details).
  8. Update the module state in the database.
  9. Update the translations in the database from the addon's translations (refer to Chapter 12, Internationalization, for details).

Note that updating an addon module that is not installed does nothing at all. However, installing an addon module that is already installed reinstalls the addon, which can have some unintended effects with some data files containing data that is supposed to be updated by the user and not updated during the normal module update process (refer to Using the noupdate and forcecreate flags in Chapter 7Module Data). There is no risk of error from the user interface, but this can happen from the command line.