是否可以在Visual Studio代码上运行和调试Odoo?如果是,请与我分享配置。
Visual Studio Code is a source code editor developed by Microsoft for Windows, Linux and macOS. It includes support for debugging, embedded Git control, syntax highlighting, intelligent code completion, snippets, and code refactoring. It is free and open-source, although the official download is under a proprietary license.
我想添加更新的答案,因此我正在共享我正在使用的简单
launch.json
脚本。此脚本假定odoo位于项目文件夹中。vscode版本:1.39.2(2019年9月)
奥多版本:11
关于
launch.json
:https://code.visualstudio.com/docs/editor/debugging#_launch-configurations是的,您甚至可以使用VSCode调试Odoo:
首先,需要在VSCode中安装Python Extension。
将安装Odoo的文件夹添加到当前项目中。您可以使用功能Multiroot Workspaces。我认为在这种情况下很方便:在一个文件夹中打开项目模块,在另一个文件夹中打开Odoo
然后,如果您想开始调试,只需单击Debug按钮,然后单击侧边栏顶部的控制盘。文件
launch.json
将打开,您只需将此元素添加到底部。添加后,您就可以在VSCode下运行Odoo了。有关启动配置的详细信息click here
现在可以像往常一样创建断点。您也可以使用调试器控制台。如果像我一样使用属性:
"console": "externalTerminal"
,则可以同时在外部控制台中显示日志注意:如果只想运行odoo,可以在VSCode中使用集成控制台
注意2:我建议也安装the Odoo Snippets extension。
我知道我有点晚了,但我已经设法和奥多11一起工作了。
我的安装路径是“C:\程序文件(x86)\ Odoo 11.0\server”
现在打开vs代码并转到工作区设置并粘贴:
}
保存并在vs“C:\程序文件(x86)\ Odoo 11.0\server\Odoo”中打开代码文件夹
然后转到调试设置和新的配置文件并粘贴以下代码:
}
然后按一下运行按钮。记住vs代码可能会给你一些警告,按忽略按钮,等待控制台打开,你就完成了。享受调试和编码。
别忘了从窗口服务中停止Odoo服务。
相关问题 更多 >
编程相关推荐