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

There's more…

Be careful about the dependency handling. Consider an instance where you want to have the sale, sale_stock, and sale_specific addons installed, with sale_specific depending on sale_stockand sale_stock depending on sale. To install all three, you only need to install sale_specific, as it will recursively install the sale_stock and sale dependencies. To update all three, you need to update sale, as this will recursively update the reverse dependencies sale_stock and sale_specific.

Another tricky part is when you add a dependency to an addon that already has a version installed. To continue with the previous example, imagine that you add a dependency on stock_dropshipping in sale_specific. Updating the addon sale_specific will not automatically install the new dependency, neither will requesting the installation of
sale_specific. In this situation, you can get very nasty error messages because the Python code of the addon is not successfully loaded, but the data of the addon and the models tables in the database are present. To solve this, you need to stop the instance and manually install the new dependency.