Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Social media Marketing
    • E-mailmarketing
    • SMS Marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Goedkeuringen
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelzaak
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Food & Hospitality
    • Bar en Pub
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brewery
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Trades
    • Klusjesman
    • IT-hardware & support
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Browse all Industries
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijs- programma
    • Scale Up! Business Game
    • Bezoek Odoo
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Word een Partner
    • Services for Partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Boekhouding
  • Voorraad
  • PoS
  • Project
  • MRP
All apps
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

How to properly import odoo in VisualStudio Code

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
configurationimportwarningodoo11
9 Antwoorden
27237 Weergaven
Avatar
Sebastian


First of i want to say that this issue is not breaking my installation its just hindering in my workflow.

When i import the odoo module like so: "from odoo import api, models, fields" i get the follwing warning:

'unresolved import 'odoo'Python(unresolved-import)' and there is a wavy line  underneath the word odoo.

Also because VSCode doesnt recognize odoo everytime the work fields is written i get a warning: 'Undefined variable:' fields'

As i said before i can compile and everything runs like expected but i see alot of warning i cant get rid of.

I googled the issue but couldnt find anything that fixed the problem.

I am probably missing something in my config files somewhere. 

Thanks for your help in advance.

Best wishes,

 Sebastian


2
Avatar
Annuleer
Avatar
Hayagreeva Aditya Kasibhotla
Beste antwoord

To properly import odoo without a sweat, there's a simple tutorial: 


1
Avatar
Annuleer
Avatar
ANGEL ADAN RAMIREZ ISEA
Beste antwoord

File -> Preferences -> Settings -> type import -> Choose Python on the left

Click on "Edit in settings.json":

"python.analysis.extraPaths": ["/your/path/to/odoo-16.0/" ]

Restart VS Code and enjoy.

4
Avatar
Annuleer
Avatar
Michael
Beste antwoord

Following process worked for me:

Open Workspace Settings:

  • In the Command Palette, search for Preferences: Open Workspace Settings (JSON), or select the workspace tab if you see it in the settings menu.

Add python.analysis.extraPaths in Workspace settings.json:

  • Add the following line with the path to your Odoo source:
    jsonCopy code"python.analysis.extraPaths": [
        "/your/path/to/odoo-16.0/"
    ]
    
  • Replace "/your/path/to/odoo-16.0/" with the actual path to your Odoo source folder.

Save and Restart:

  • Save your changes in the settings.json file and restart VS Code to apply the settings.
0
Avatar
Annuleer
Avatar
Rome Maristany
Beste antwoord

Hi, I know your question was a long time ago but I'm new to odoo and I have this same problem. Finally, how did you solve it? I tried the solutions they gave you but it didn't work.

0
Avatar
Annuleer
Avatar
osvaldo farfan
Beste antwoord

Hello, I find myself having the same problem, did you manage to solve it????

I have spent several days looking for a way to solve the problem but still can't find it... 

0
Avatar
Annuleer
Avatar
IB Teguh TM
Beste antwoord

Do you have how to solve this problem ?

i have temporary problem to solve it
1. add the folder script in setting.json and add python.analysis.extraPaths setting for the workspace.
'Import "Path.to.own.script" could not be resolved Pylance (reportMissingImports)' in VS Code using Python 3.x on Ubuntu 20.04 LTS. but this is not work for me
2. below the SO answer, there are (1) 
In VS code you can edit the setting.json file. If you add "python.analysis.useImportHeuristic": true the linting error will be removed. i think this is dangerous because make you not cant see problem
3. (2) The alternative is to add # type: ignore at the end of the import code. i like this answer after compile and there are no error, i can put #type : ignore and problem is gone

0
Avatar
Annuleer
Avatar
Shringar Gupta
Beste antwoord

That wavy line you are seeing because you may be opening a folder which contains odoo. Try opening only odoo named folder that you have downloaded at the time of installation. Your issue will be solved.

It troubled me as well when i initially started using odoo.

0
Avatar
Annuleer
Raymond Ho

On the contrary, the squiggly line appears because the odoo folder is not included, so the vscode app opens the directory at the next level. For example, your vscode works in the odoo-dev/my_library folder, and the odoo module from odoo import models, fields will have wavy lines. To solve it simply, vscode can open the directory odoo-dev at the next level as the working directory. Tip: There's odoo-dev/odoo inside

Avatar
Sebastian
Auteur Beste antwoord

Sorry our company only uses VSCode so PyCharm is not an option for us. Thank you anyways

0
Avatar
Annuleer
Avatar
Fernando La Chica Mera
Beste antwoord

Have you tried PyCharm? This editor has many advantages over VSCode as is its search for code based on regex. It does not answer your question but the alternative is worth trying.

0
Avatar
Annuleer
André Canilho

VS Code does everything you can do with Pycharm and more, Regex search is possible.
The only issue I've seen, which is more of a Windows + VsCode issue, is that it doesn't always end the process on rebuild.

PS: I've used PyCharm for 3 Years, and VS Code since it was released for multiple languages and stacks.

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Show warning in a wizard
wizard warning odoo11
Avatar
Avatar
1
aug. 25
8213
Import data for accounting module
configuration import counting
Avatar
Avatar
Avatar
2
mei 24
3086
Odoo 11 - MemoryError - RuntimeError: can't start new thread - The Connection Pool Is Full
configuration server500 odoo11
Avatar
0
okt. 20
7024
Odoo losing connection when few people working at the same time
configuration performance odoo11
Avatar
Avatar
6
sep. 20
5657
I can't import data to odoo from an excel table Opgelost
import employee odoo11
Avatar
Avatar
2
nov. 19
7981
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Word een Partner
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now