自从有了vscode以后就一直用它作为odoo的开发环境,开发中,常见的就是几种场景
1、调式当前文件。
2、调试指定文件。
3、远程调试,需要配合debugpy。
4、调试ODOO项目。
下面给一个模板,可以基于这个模板去写自己的配置
{
"version": "0.2.0",
"configurations": [ {
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
}
,
{
"name": "Python:odoo",
"type": "python",
"request": "launch",
"stopOnEntry": false,
"justMyCode": false,
"python": "${command:python.interpreterPath}",
"console": "integratedTerminal",
"program": "${workspaceRoot}/odoo-bin",
"args": [ "--config=./configs/odoo.conf",
"--dev=xml"
],
"cwd": "${workspaceRoot}",
"env": {}
,
"envFile": "${workspaceRoot}/.env",
"debugOptions": [ "RedirectOutput"
]
}
,
{
"name": "Python:client",
"type": "python",
"request": "launch",
"program": "${workspaceRoot}/third_party/ylhc_modeler/ylhc_client/YlhcMain.py",
"console": "integratedTerminal",
"justMyCode": true
}
,
{
"name": "odoo remote",
"type": "debugpy",
"request": "attach",
"connect": {
"host": "124.xxxx.xxx.xxxx",
"port": 12345
}
,
"pathMappings": [ {
"localRoot": "${workspaceFolder}/third_party/ylhc_spell",
"remoteRoot": "/extra-addons/ylhc_spell"
}
],
"justMyCode": false
}
]
}