vscode-odoo icon indicating copy to clipboard operation
vscode-odoo copied to clipboard

base not recognized

Open weinni2000 opened this issue 9 months ago • 9 comments

Everything works in my setup except the base folder is not resolved.

Image I get this error message: Could not find module 'base'

I tried to add it: "python.analysis.extraPaths": [ "XXX/odoo/odoo/addons",

but still no success.

Background: I use a doodba setup and everything else works as expected. Any pointers about the root cause of this?

weinni2000 avatar Feb 09 '25 04:02 weinni2000

Hello @weinni2000 ,

What version of Odoo are you working on ?

trinhanhngoc avatar Feb 09 '25 05:02 trinhanhngoc

18, but I will later check if it's the same problem in the other versions

weinni2000 avatar Feb 09 '25 07:02 weinni2000

@weinni2000 ,

What about other standard modules (account, sale,...), are they also not recognized ?

trinhanhngoc avatar Feb 09 '25 07:02 trinhanhngoc

all other modules work fine except in the xml views I get this error message. Everything else works like a charm. Thanks for the tool, it's really helpful.

Image

weinni2000 avatar Feb 09 '25 11:02 weinni2000

@weinni2000 ,

How does your project structure look in VSCode?

trinhanhngoc avatar Feb 09 '25 14:02 trinhanhngoc

I use doodba from oca: (https://github.com/Tecnativa/doodba) So I have multiple folders like this for every odoo version. The repos are all in the src folder inluding odoo and enterprise, the oca repos and my custom ones. (That's how it's recommended for doodba

Image

weinni2000 avatar Feb 10 '25 05:02 weinni2000

@weinni2000 ,

Can you try editing odoo/addons/base/__manifest__.py to see if the problem goes away? Any changes in manifest files will trigger modules reindexing.

trinhanhngoc avatar Feb 10 '25 09:02 trinhanhngoc

Hi, this solved the depends error.

I then also added a line to src/odoo/odoo/addons/base/models/ir_ui_view.py and then the errors in the view xml's also went away. This works for me but would be nice if this works out of the box.

weinni2000 avatar Feb 10 '25 10:02 weinni2000

@weinni2000 ,

The indexing is activated automatically on new files and changed files. I will add an action for manually reindexing whole project if there are problems with indexing.

trinhanhngoc avatar Feb 10 '25 14:02 trinhanhngoc