- Odoo 12 Development Essentials
- Daniel Reis
- 374字
- 2021-07-02 14:18:44
Preparing the addons path
An addons module is a directory that contains an Odoo manifest file, and provides a new app or an additional feature for an existing app. The addons module's path is a list of directories, where the Odoo server will look for available addons. By default, the addons path includes the official apps bundled with Odoo, in the odoo/addons directory, and the base module providing the core features, in the odoo/odoo/addons directory.
We should add our own modules in specific directories, whether created by us, or downloaded from the App Store or elsewhere. For the Odoo server to be able to discover them, we should add these directories to the Odoo addons paths.
Following the instructions in Chapter 2, Preparing the Development Environment, we should have the Odoo server code at ~/odoo-dev/odoo/. Best practices dictates that our code should be kept in its own directory, and never mixed up with Odoo's original code. So, to host our custom modules, we will use a new addons directory alongside Odoo, which should be included in the addons path: ~/odoo-dev/custom-addons.
To add the new addons directory to the Odoo server addons path, change the current directory, and start the server with the appropriate addons path configuration:
$ cd ~/odoo-dev $ ./odoo/odoo-bin -d todo --addons-path="custom-addons,odoo/addons" --save
The --save option saves the options you used in a configuration file. This spares us from repeating them every time we restart the server; just run ./odoo-bin and the last saved option will be used. You can specify the configuration file and location to use (and save to) using the -c option.
Look closely at the server log. It should have an INFO ? odoo: addons paths:[...] line. It should include our custom-addons directory.
Remember to also include any other addons directories you might be using. For instance, if you have a ~/odoo-dev/extra directory that contains additional modules to be used, you might want to include them too, using the --addons-path option:
--addons-path="custom-addons,extra,odoo/addons"
Now we need the Odoo instance to acknowledge the new module we just added.
- Excel 2019公式與函數應用大全(視頻教學版)
- Excel高效辦公:會計與財務管理(AI版)
- Office 2019高效辦公三合一從入門到精通(視頻自學版)
- 金蝶ERP-K/3培訓教程:財務/供應鏈/生產制造(第2版)
- Excelize權威指南
- 電腦辦公(Windows 10 + Office 2016)入門與提高
- 一圖抵萬言:從Excel數據到分析結果可視化
- Excel 2010高效辦公:市場與銷售管理
- 從零開始學Excel VBA
- 中文版AutoCAD 2012基礎與應用培訓教程
- 零基礎學游戲UI設計
- Mapping and Visualization with SuperCollider
- 巧學活用Word
- Excel數據處理與可視化
- Excel 2010 SQL完全應用