官术网_书友最值得收藏!

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$
主站蜘蛛池模板: 岑溪市| 阳高县| 禹城市| 永昌县| 上杭县| 漾濞| 名山县| 牡丹江市| 德钦县| 诏安县| 天等县| 开原市| 阳朔县| 元阳县| 塔河县| 山西省| 益阳市| 绥芬河市| 利川市| 垫江县| 陵川县| 虎林市| 谢通门县| 新乐市| 石林| 桓仁| 崇义县| 鄂州市| 于田县| 卢龙县| 松溪县| 乌海市| 娱乐| 乌鲁木齐县| 毕节市| 衡阳市| 江山市| 威宁| 昌都县| 南丹县| 乌拉特后旗|