Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • eLearning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Información
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y asistencia informática
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Browse all Industries
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Services for Partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyecto
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

bom creation via jsonrpc order of operations

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
pythonjsonrpcodoo16features
1 Responder
4858 Vistas
Avatar
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
Avatar
Descartar
Avatar
MUHAMMAD Imran
Mejor respuesta

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
Avatar
Descartar
kym watts
Autor

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.

¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Inscribirse
Publicaciones relacionadas Respuestas Vistas Actividad
Add LogNote to Order Delivery using JSON-RPC
python jsonrpc odoo16features
Avatar
Avatar
Avatar
Avatar
3
jul 23
4275
How to solve error 'numpy' has no attribute 'float' in Python
python odoo16features
Avatar
Avatar
Avatar
3
feb 23
6410
product.template form name doesnt update Resuelto
jsonrpc Docker odoo16features
Avatar
Avatar
Avatar
Avatar
3
nov 24
3927
Partner Ledger customize
accounting python odoo16features
Avatar
Avatar
1
feb 24
2748
Error while generating a report in python (Record does not exist or has been deleted) Resuelto
python report odoo16features
Avatar
Avatar
Avatar
2
may 23
4308
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y totalmente integrado.

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