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

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$
主站蜘蛛池模板: 吉木乃县| 和林格尔县| 芦山县| 保靖县| 化德县| 文昌市| 巨鹿县| 常德市| 宣化县| 马尔康县| 淮北市| 溆浦县| 哈密市| 二连浩特市| 青浦区| 田东县| 砚山县| 耿马| 定襄县| 平和县| 云安县| 华容县| 百色市| 岐山县| 道孚县| 夹江县| 绥化市| 香港 | 辛集市| 平舆县| 利川市| 阳谷县| 宜良县| 汉源县| 兴城市| 广河县| 扶余县| 昌吉市| 九江县| 法库县| 高碑店市|