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
    • Real Estate Agency
    • Архітектурна фірма
    • Будівництво
    • Управління нерухомістю
    • Садівництво
    • Асоціація власників нерухомості
    Consulting
    • Accounting Firm
    • Партнер Odoo
    • Marketing Agency
    • Юридична фірма
    • Придбання Талантів
    • Аудит та сертифікація
    Виробництво
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Корпоративні подарунки
    Здоров'я & Фітнес
    • Спортивний клуб
    • Оптика
    • Фітнес-центр
    • Практики здоров'я
    • Аптека
    • Салон краси
    Trades
    • Ремонтник
    • IT-обладнання та Підтримка
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • 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
Про цей форум
Допомога

__init__.py python import file

Підписатися

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

Це запитання позначене
pythonimportfile__init__.py
7 Відповіді
28175 Переглядів
Аватар
omprakash

Hai Friends ,

First I thank everyone , who give such support for newbie . When I started learning about creating custom module . Some Question raised in my mind .
  1. In __init__.py , what are the module (or) sub-module to be imported ?

  2. If my module _inherit another module , should i import the _inherit module in __init__.py ?

  3. What is purpose of declaring the module in __init__.py ?

Please clarify my doubt & once again thanks for everyone .

Thanks & Regards OMPRAKASH.A

1
Аватар
Відмінити
Sehrish

You need to know about odoo module structure: https://goo.gl/cPZ6gM

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

n __init__.py file the modules which u going to import are ...the business logic files, having extension .py , for sales.py .

There is no need of _inheriting the module in __init__.py file.

__init__.py is used to initialize your module and its mandatory in each and every module u create

1
Аватар
Відмінити
omprakash
Автор

Hi mihir shah , Thanks for your immediate reply . I can understand your points . If you explain with some example it make more useful for me .. And once again thanks for your reply ... OMPRAKASH.A

mihir shah

Hi omprakash , for eg. If you are creating a customized module name school_management. in that first you create __init__.py file in that you import stu_reg ,after that __openerp_.py in this file you declare about all the views , dependencies ,(if any ) else always base. then you create stu_reg.py file name should be same as which is import in __init_.py file. In stu_reg.py file import fields ,osv and declare all the object models with there fields and data types . also you can define function if needed in stu_reg.py file

mihir shah

now create stu_reg.xml file for the view purpose.the structure of the xml view is given in documentation . so now when add this custom module to addons folder and try to install it , openerp by default first calls __init__.py file then __openerp__.py for initializing your module . hope my ans satisfying

omprakash
Автор

Hi mihir shah , Thanks for your reply .Now i have idea about __init__.py file . But need more clarification please help me ... 1.) except import stu_reg , whether we will import another module ? If we import when ? And once again thanks for your reply ....OMPRAKASH.A

mihir shah

Hi omprakash, yes you can import n number of py files in __init__.py. after importing stu_reg i want to register teacher so i made tech_reg.py file. then i just have to import tech_reg in __init__.py file. But i would suggest that ..if you have different module for different business logic ,so as to use modular structure of openerp. and makes it more usable

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 Відповіді Переглядів Дія
Import py file of a custom module Вирішено
python import file
Аватар
1
бер. 21
19838
import an external file to a custom module
import file
Аватар
Аватар
1
бер. 15
10903
how to import outside file (from another module)
module import file
Аватар
Аватар
Аватар
2
жовт. 23
4988
current transaction is aborted, commands ignored until end of transaction block
python file odoo
Аватар
Аватар
1
січ. 23
7382
How to generate a txt file and save it to Downloads directory
python file txt
Аватар
0
вер. 17
5980
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
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