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
Про цей форум
Допомога

bom creation via jsonrpc order of operations

Підписатися

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

Це запитання позначене
pythonjsonrpcodoo16features
1 Відповісти
4848 Переглядів
Аватар
kym watts

Hello,


Im working on some processes that allow an external application author products and their related boms.

I have manufacturing, inventry and variants on as options, in case that makes a difference.


I already have my head around doing CRUD operations via the jsonrpc, i have spent a bunch of time tracing fields to models and this is what i think needs to occur.


product.template ( product.product ) > mrp.bom > a mrp.bom.line per component. 

Do i need to go back to each parent to update it with information, or as long as i add the correct parent id to its respected field the back end will do any additonal links required?


Does using the odoorpc simplify this ?


Appreciate any help anyone can provide here.

Cheers
kym


0
Аватар
Відмінити
Аватар
MUHAMMAD Imran
Найкраща відповідь

To create a bill of materials (BOM) using JSON-RPC in Odoo, you will need to follow a similar sequence of steps as outlined above. Here is a more detailed description of the process:


Connect to the JSON-RPC server: You will need to use the jsonrpc module to establish a connection to the JSON-RPC server. You can do this by calling the jsonrpc.ServerProxy function and passing it the URL of the server, as well as any authentication information that is required.


Send an RPC request to create the BOM: Once you have established a connection to the server, you can use the execute_kw method to send an RPC request to create the BOM. This method takes three arguments: the database name, the user id, and the password. You will also need to pass a fourth argument that is a dictionary containing the details of the BOM that you want to create, such as the name and the items that should be included.


Receive an RPC response: The server will respond to your request with an RPC response, which will include the ID of the newly created BOM.


Verify the results: After you have received the RPC response, you can use the read method to retrieve the details of the newly created BOM and verify that it was created as expected.


Close the connection: Once you have finished interacting with the JSON-RPC server, you should close the connection by calling the close method.


Here is an example of how you might create a BOM using JSON-RPC in Odoo:


Copy code

import jsonrpc


# Connect to the JSON-RPC server

server = jsonrpc.ServerProxy('http://localhost:8069/jsonrpc')


# Authenticate and create the BOM

uid = 1

password = 'admin'

database = 'mydatabase'

product_tmpl_id = 5

bom_id = server.execute_kw(database, uid, password, 'mrp.bom', 'create', [{

    'product_tmpl_id': product_tmpl_id,

    'product_qty': 1,

    'type': 'phantom',

    'bom_line_ids': [

        (0, 0, {'product_id': 2, 'product_qty': 1}),

        (0, 0, {'product_id': 3, 'product_qty': 2}),

    ],

}])


# Verify the results

bom = server.execute_kw(database, uid, password, 'mrp.bom', 'read', [bom_id])

print(bom)


# Close the connection

server.close()

0
Аватар
Відмінити
kym watts
Автор

Ah fantastic,
That is good to know that i can create the bom lines in the 'mrp.bom' directly, saves a bit of hassle.

thanks for your help.

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 Відповіді Переглядів Дія
Add LogNote to Order Delivery using JSON-RPC
python jsonrpc odoo16features
Аватар
Аватар
Аватар
Аватар
3
лип. 23
4273
How to solve error 'numpy' has no attribute 'float' in Python
python odoo16features
Аватар
Аватар
Аватар
3
лют. 23
6408
product.template form name doesnt update Вирішено
jsonrpc Docker odoo16features
Аватар
Аватар
Аватар
Аватар
3
лист. 24
3924
Partner Ledger customize
accounting python odoo16features
Аватар
Аватар
1
лют. 24
2744
Error while generating a report in python (Record does not exist or has been deleted) Вирішено
python report odoo16features
Аватар
Аватар
Аватар
2
трав. 23
4306
Спільнота
  • Навчальний посібник
  • Документація
  • Форум
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