Skip to Content
Odoo Меню
  • Увійти
  • Спробуйте це безкоштовно
  • Додатки
    Фінанси
    • Бухоблік
    • Виставлення рахунку
    • Витрати
    • Електронні таблиці (BI)
    • Документи
    • Підпис
    Продажі
    • CRM
    • Продажі
    • POS Магазин
    • POS Ресторан
    • Підписки
    • Оренда
    Веб-сайти
    • Конструктор веб-сайту
    • Електронна комерція
    • Блог
    • Форум
    • Живий чат
    • Електронне навчання
    Ланцюг поставок
    • Склад
    • Виробництво
    • PLM
    • Купівлі
    • Технічне обслуговування
    • Якість
    Кадри
    • Співробітники
    • Рекрутинг
    • Відпустки
    • Оцінювання
    • Рекомендації
    • Автотранспорт
    Маркетинг
    • Маркетинг соцмереж
    • Email-маркетинг
    • SMS-маркетинг
    • Події
    • Автом. маркетингу
    • Опитування
    Послуги
    • Проект
    • Табелі
    • Виїзне обслуговування
    • Служба підтримки
    • Планування
    • Призначення
    Продуктивність
    • Обговорення
    • Схвалення
    • IoT
    • IP-телефонія
    • База знань
    • WhatsApp
    Сторонні модулі Odoo Studio Платформа Odoo Cloud
  • Сфери
    Роздрібна торгівля
    • Книжковий магазин
    • Магазин одягу
    • Магазин меблів
    • Продуктовий магазин
    • Магазин будівельних матеріалів
    • Магазин іграшок
    Food & Hospitality
    • Бар та паб
    • Ресторан
    • Фастфуд
    • Guest House
    • Дистриб'ютор напоїв
    • Hotel
    Нерухомість
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Консалтинг
    • Бухгалтерська компанія
    • Партнер Odoo
    • Агенція маркетингу
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Меблі
    • Їжа
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Системи сонячної енергії
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Інші
    • Nonprofit Organization
    • Екологічна агенція
    • Оренда білбордів
    • Фотографія
    • Лізинг велосипедів
    • Реселлер програмного забезпечення
    Browse all Industries
  • Спільнота
    Навчання
    • Навчальний посібник
    • Документація
    • Сертифікації
    • Тренування
    • Блог
    • Подкаст
    Сприяйте Освіті
    • Програма навчання
    • Бізнес гра Scale Up!
    • Відвідайте Odoo
    Отримайте програмне забезпечення
    • Завантаження
    • Порівняйте версії
    • Релізи
    Співпрацюйте
    • Github
    • Форум
    • Події
    • Переклади
    • Стати партнером
    • Services for Partners
    • Зареєструйте вашу бухгалтерську фірму
    Отримайте послуги
    • Знайдіть партнера
    • Знайдіть бухгалтера
    • Зустріньтеся з консультантом
    • Послуги з впровадження
    • Референси клієнтів
    • Підтримка
    • Оновлення
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Отримати демо
  • Ціни
  • Допомога

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

  • CRM
  • e-Commerce
  • Бухоблік
  • Склад
  • PoS
  • Проект
  • MRP
All apps
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
All Posts Люди Значки
Мітки (View all)
odoo accounting v14 pos v15
Про цей форум
Допомога

How to properly import odoo in VisualStudio Code

Підписатися

Отримуйте сповіщення про активність щодо цієї публікації

Це запитання позначене
configurationimportwarningodoo11
9 Відповіді
27268 Переглядів
Аватар
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
Аватар
Відмінити
Аватар
Hayagreeva Aditya Kasibhotla
Найкраща відповідь

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


1
Аватар
Відмінити
Аватар
ANGEL ADAN RAMIREZ ISEA
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Michael
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Rome Maristany
Найкраща відповідь

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
Аватар
Відмінити
Аватар
osvaldo farfan
Найкраща відповідь

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
Аватар
Відмінити
Аватар
IB Teguh TM
Найкраща відповідь

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
Аватар
Відмінити
Аватар
Shringar Gupta
Найкраща відповідь

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
Аватар
Відмінити
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

Аватар
Sebastian
Автор Найкраща відповідь

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

0
Аватар
Відмінити
Аватар
Fernando La Chica Mera
Найкраща відповідь

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
Аватар
Відмінити
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.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Реєстрація
Related Posts Відповіді Переглядів Дія
Show warning in a wizard
wizard warning odoo11
Аватар
Аватар
1
серп. 25
8219
Import data for accounting module
configuration import counting
Аватар
Аватар
Аватар
2
трав. 24
3094
Odoo 11 - MemoryError - RuntimeError: can't start new thread - The Connection Pool Is Full
configuration server500 odoo11
Аватар
0
жовт. 20
7033
Odoo losing connection when few people working at the same time
configuration performance odoo11
Аватар
Аватар
6
вер. 20
5662
I can't import data to odoo from an excel table Вирішено
import employee odoo11
Аватар
Аватар
2
лист. 19
7993
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
Open Source
  • Завантаження
  • Github
  • Runbot
  • Переклади
Послуги
  • Хостинг Odoo.sh
  • Підтримка
  • Оновлення
  • Кастомні доробки
  • Навчання
  • Знайдіть бухгалтера
  • Знайдіть партнера
  • Стати партнером
Про нас
  • Наша компанія
  • Торгові активи
  • Зв'яжіться з нами
  • Вакансії
  • Події
  • Подкаст
  • Блог
  • Клієнти
  • Юридичні документи • Конфіденційність
  • Безпека
الْعَرَبيّة 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 - це набір програм для роботи з відкритим кодом, які охоплюють всі ваші потреби компанії: CRM, електронна комерція, бухгалтерський облік, склад, точка продажу, управління проектами тощо.

Унікальна пропозиція Odoo - це одночасно дуже проста у використанні та повністю інтегрована.

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