-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot resolve from odoo.addons.* when the module is in oca folder or enterprise #81
Comments
Hello @davdenic , If the extension cannot detect addons paths automatically, you can manually add addons paths to the |
i've already tried but it doesn't work "python.analysis.extraPaths": [ |
Can you provide screenshots of the import errors, your VSCode workspace structure and the extraPaths setting? |
@davdenic I had the same problem, and I fixed it by running 'Python: Clear Cache and Reload Window' from the command palette in VSCode after updating the extraPaths |
I have the same issue. Still trying to solve it. |
@davdenic I just solved the issue by configuring the python.analysis.extraPaths. I am pretty sure your issue is also related to that. Please try to define the extra paths in the following way: "python.analysis.extraPaths": [ Also, please be sure that all the paths are really loaded by VS code. How did you define the paths? Can you show me your settings.json file? |
Beside the extraPaths setting, you also need to open the Odoo source code ( |
The extension excludes hidden files ( |
What about Magic Fields validation? I have this small demo with Odoo Dev Container. |
The magic fields are declared in odoo-stubs. The extension needs to detect your odoo version to set the corresponding odoo-stubs. There may a problem with your project structure so the extension failed to detect your odoo version. Please make sure the symbolic link to the odoo source code is also named
|
I have a problem that seems to be related. It seems like the imports can be resolved. it does the indexing on the correct paths and there are no error in the imports. but when that is done I get no suggestions at all. When hitting the suggestions shortcut it says "No suggestions." my directory structure: Odoo-Dev Can anyone help? |
@jankkm , Can you take some screenshots of your problem? |
@jankkm , Can you take a screenshot when hovering |
@jankkm , Your problem is strange. Can you take a screeshot of your project structure in VSCode? |
devcontainer.json
I think with that you can get an idea how I set this thing up. |
@jankkm , I could not reproduce the problem. You can try testing if a simpler project structure with just the odoo source code (without |
@jankkm , So the problem is caused by your enterprise folder. Can you take a screenshot of the structure of your enterprise folder? |
@jankkm , Your enterprise folder is a full version of odoo, not just the enterprise addons. I think it's the problem. Try to use the community version OR the enterprise version, not both.
|
that indeed was the issue. running just the enterprise works fine. thank you so much for helping me out! |
Hi, on my local i'm developing on visual code and I'm using some modules from oca and enterprise. it cannot resolve the imports from there.
"Import "odoo.addons.fastapi.tests.common" could not be resolved"
the addon path is correctly configured, in fact all modules work perfectly.
instead native odoo addons and my homemade modules that are in the addons folder are correctly displayed in the autocomplete
for that reason i believe is a misconfiguration but i cannot figurate out how to fix it.
i'm developing on mac, my folder structure is
.
├── addons
├── build
├── config
├── enterprise
├── k3s
├── oca
├── odoo
├── scripts
├── snippets
├── template
├── themes
├── thirdparty
├── tmp
└── venv16.0
my addon path shows
INFO ? odoo: addons paths: ['/Volumes/DEV/odoo-myproject/odoo/odoo/addons', '/Volumes/DEV/odoo-myproject/venv16.0/lib/python3.11/site-packages/odoo/addons', '/Users/dd/Library/Application Support/Odoo/addons/16.0', '/Volumes/DEV/odoo-myproject/themes', '/Volumes/DEV/odoo-myproject/odoo/addons', '/Volumes/DEV/odoo-myproject/oca/partner-contact', '/Volumes/DEV/odoo-myproject/addons/server_tools', '/Volumes/DEV/odoo-myproject/oca/web', '/Volumes/DEV/odoo-myproject/oca/server-tools', '/Volumes/DEV/odoo-myproject/oca/sale-workflow', '/Volumes/DEV/odoo-myproject/oca/purchase-workflow', '/Volumes/DEV/odoo-myproject/oca/server-env', '/Volumes/DEV/odoo-myproject/addons/sale_workflow', '/Volumes/DEV/odoo-myproject/addons/hr', '/Volumes/DEV/odoo-myproject/addons/purchase_workflow', '/Volumes/DEV/odoo-myproject/enterprise', '/Volumes/DEV/odoo-myproject/oca/bank-payment', '/Volumes/DEV/odoo-myproject/oca/server-backend', '/Volumes/DEV/odoo-myproject/oca/account-invoicing', '/Volumes/DEV/odoo-myproject/addons/partner_contact', '/Volumes/DEV/odoo-myproject/addons/account_invoicing', '/Volumes/DEV/odoo-myproject/addons/mymodules', '/Volumes/DEV/odoo-myproject/oca/web-api', '/Volumes/DEV/odoo-myproject/oca/rest-framework', '/Volumes/DEV/odoo-myproject/oca/server-auth']
in the oca folder there are the modules i'm using, and as said are perfectly working in my odoo instance
oca
├── account-invoicing
├── bank-payment
├── partner-contact
├── purchase-workflow
├── rest-framework
├── sale-workflow
├── server-auth
├── server-backend
├── server-env
├── server-tools
├── web
└── web-api
The text was updated successfully, but these errors were encountered: