简体   繁体   English

odoo PyCharm 配置/没有名为“odoo”的模块

[英]odoo PyCharm configuration / no module named 'odoo'

I'm newbee in programming and I need some help.我是编程新手,我需要一些帮助。

I have to work with PyCharm and Odoo, so my point is to configure PyCharm for Odoo debugging.我必须使用 PyCharm 和 Odoo,所以我的意思是配置 PyCharm 以进行 Odoo 调试。 First of all I made a module and a model, it perfectly work with database(i can see and check it).首先,我制作了一个模块和一个 model,它与数据库完美配合(我可以看到并检查它)。 I want PyCharm not to highlight word 'odoo', 'models' and 'fields' by red line(unresolved reference) or green line(Package containing module 'odoo' is not listed in project requirements)我希望 PyCharm 不要用红线(未解决的参考)或绿线(项目要求中未列出包含模块 'odoo' 的包)突出显示单词 'odoo'、'models' 和 'fields'

I've read lots of tutorials and manuals but nothing helps me.我已经阅读了很多教程和手册,但没有任何帮助。 I think the problem is that PyCharm doesn't see the odoo package (or smth like that).我认为问题在于 PyCharm 没有看到 odoo package (或类似的东西)。 There is no odoo in requirements.txt requirements.txt 中没有 odoo

So, I need to coonect PyCharm and Odoo, without red or green underlining.所以,我需要连接 PyCharm 和 Odoo,没有红色或绿色下划线。 PyCharm doesn't see the Odoo module. PyCharm 看不到 Odoo 模块。 Maybe the problem with the fact that my project folder located not in odoo main folder, but maybe im wrong.也许问题在于我的项目文件夹不在 odoo 主文件夹中,但我可能错了。 Sorry for my english.对不起我的英语不好。

Install and create virtualenv and install odoo.安装创建virtualenv 并安装 odoo。 Then add virtualenv path to pycharm.然后virtualenv 路径添加到 pycharm。

SOLVED: You just need to add odoo folder to the source folder of the project in PyCharm settings: File - Settings - Project Structure - + Add content root There you should pick Odoo13\server folder已解决:您只需在 PyCharm 设置中将 odoo 文件夹添加到项目的源文件夹:文件 - 设置 - 项目结构 - + 添加内容根目录 您应该选择 Odoo13\server 文件夹

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM