- Odoo 11 Development Essentials(Third Edition)
- Daniel Reis
- 433字
- 2021-08-27 19:32:42
Upgrading a module
Developing a module is an iterative process, and you will want changes made on source files to be applied to and made visible in Odoo.
In many cases, this is done by upgrading the module: look up the module in the Apps list and once it is already installed, you will have an Upgrade button available.
However, when the changes are only in Python code, the upgrade may not have an effect. Instead of a module upgrade, an application server restart is needed. Since Odoo loads Python code only once, any later changes to code require a server restart to be applied.
In some cases, if the module changes were in both data files and Python code, you might need both the operations. This is a common source of confusion for new Odoo developers.
But fortunately, there is a better way. The safest way to make all our changes to a module effective is to stop and restart the server instance, requesting our modules to be upgraded to our work database.
In the terminal where the server instance is running, use Ctrl + C to stop it. Then, start the server and upgrade the todo_app module using the following command:
$ ./odoo-bin -d todo -u todo_app
The -u option (or --update in the long form) requires the -d option and accepts a comma-separated list of modules to update. For example, we could use -u todo_app,mail. When a module is updated, all other installed modules depending on it are also updated. This is essential to maintain the integrity of the inheritance mechanisms, used to extend features.
Throughout the book, when you need to apply the work done in modules, the safest way is to restart the Odoo instance with the preceding command. Pressing the up arrow key brings to you the previous command that was used. So, most of the time, you will find yourself using the Ctrl + C, up, and Enter key combination.
Similarly, a -i option, or --install, is also available to perform the installation (or reinstallation) of modules. For new modules, you had to update the module list in the web client before they could be installed, but since Odoo 11 this has not been necessary and new modules can immediately be installed.
- Excel 2010中文版完全自學(xué)手冊
- Linux操作系統(tǒng)與服務(wù)配置
- Word/Excel/PPT 2010辦公應(yīng)用從入門到精通
- Docker技術(shù)入門與實(shí)戰(zhàn)
- Excel財(cái)務(wù)會計(jì)應(yīng)用
- 吸引力!創(chuàng)意PPT的設(shè)計(jì)與展現(xiàn)實(shí)用法則
- 從零開始學(xué)PowerPoint 2010
- Access 2010數(shù)據(jù)庫實(shí)用教程
- Excel 2016在會計(jì)與財(cái)務(wù)管理中的應(yīng)用(微課版)
- Excel 2010高效辦公:市場與銷售管理
- Office商務(wù)辦公實(shí)用教程
- 中文版Office2016大全
- Office 2016辦公應(yīng)用從入門到精通
- DPDK應(yīng)用基礎(chǔ)
- Excel VBA應(yīng)用案例速查手冊