odoo-ide / vscode-odoo

Visual Studio Code extension for Odoo
https://marketplace.visualstudio.com/items?itemName=trinhanhngoc.vscode-odoo
41 stars 2 forks source link

custom addons not detected in vscode (its just warning) #31

Closed Burnaviour closed 10 months ago

Burnaviour commented 10 months ago

custom addons are not detected in vs code using odoo extension its auto-suggesting odoo addons but not suggest custom addons models.I have attached pyright warning. image

trinhanhngoc commented 10 months ago

Hello @Burnaviour , I need more information to be able to support:

  1. Your VSCode version + Odoo extension version
  2. Your VSCode workspace structure
Burnaviour commented 10 months ago

thank you for your response here are the details my odoo extension version is v0.6.4 and vs code version 1.81 image

trinhanhngoc commented 10 months ago

@Burnaviour , You can follow these steps:

  1. Check if the module that defines the all.users model is a dependency of the module containing the warning (directly or indirectly through depends in manifest).
  2. I assume that the custom_addons folder is a valid addons path. You need to add the custom_addons folder to the extra paths setting as documented at https://microsoft.github.io/pyright/#/import-resolution.
Burnaviour commented 10 months ago

as per my module all.users is defined and working its just the pyright which is thwing waring and the odoo extension which is unable to detect all my custom modules models. In addition before posting the issue i tried this 2nd step you mentioned there are a lot of options option the told I have defined stub path in my workspace here is my setting.json "python.analysis.stubPath": "/opt/odoo16/custom_addons", also tried these setting I have found on internet "python.autoComplete.extraPaths": [ "${workspaceRoot}/addons", "${workspaceRoot}/odoo/addons", "${workspaceRoot}/custom_addons" ], "python.analysis.typeshedPaths": [ "${workspaceRoot}/custom_addons" ],

Burnaviour commented 10 months ago

Thank you for your help i have fixed the issue