- Odoo 11 Development Essentials(Third Edition)
- Daniel Reis
- 216字
- 2021-08-27 19:32:39
The database filter option
When developing with Odoo, it is common to work with several databases, and sometimes even with different Odoo versions. Stopping and starting different server instances on the same port, and switching between different databases, can cause web client sessions to behave improperly. This is because the browser stores session cookies.
Accessing our instance using a browser window running in private mode can help avoid some of these problems.
Another good practice is to enable a database filter on the server instance to ensure that it only allows requests for the database we want to work with, ignoring all others.
Since Odoo 11.0, the --database (or -d) server option accepts a comma-separated list of database names, and only these can be used.
However, in Odoo versions before 11.0, the --database option only indicates a database to be initialized, but the other existing databases are accessible. We need to also add a filter limiting the databases that can be accessed.
This is done with the --db-filter option. It accepts a regular expression to be used as a filter for valid database names. To match an exact name, the expression should begin with ^ and end with $.
For example, to allow only the testdb database, we would use this command:
$ ~/odoo-dev/odoo/odoo-bin --db-filter=^testdb$
- Word/Excel/PPT 2007入門與提高(超值版)
- Excel高效數據處理分析:效率是這樣煉成的!
- MATLAB R2020a完全自學一本通
- WPS Office高效辦公:辦公實戰與技巧大全(8合1)
- 對比Excel,輕松學習Python報表自動化
- Matlab R2016a從入門到精通 (CAX工程應用叢書)
- Final Cut Pro X基礎培訓教程
- Excel數據透視表應用之道(雙色板)
- 電腦上網技巧現用現查
- Access VBA活用范例手冊
- 掌中寶:Word辦公應用技巧
- PPT設計的藝術:人人都用得上的PPT設計書
- 中文版Office 2016三合一辦公基礎教程
- 移動游戲UI設計專業教程
- PowerShell for Office 365應用實戰