Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

Crear una factura desde json rpc

Subscriure's

Get notified when there's activity on this post

This question has been flagged
externalapiinvoicingjsonrpc
1 Respondre
2331 Vistes
Avatar
Mike

Buenas para todos.

Estoy intentando crear facturas desde un sistema externo, por lo que antes de adentrarme en el desarrollo he decidio documentar en Postman todos los endpoints que debo utilizar de odoo. 

Ya puedo buscar clientes, crear clientes, buscar articulos y crear articulos. 
Lo que no estoy pudiendo es crear la factura, pues no encuentro documentación para la misma.

Si bien mirando el modelo de datos me aproximo a algo, pues siempre un nuevo error salta. Alguien tiene mas información sobre como se crea el json a enviar via API RPC para la creación de facturas?

Dejo por aquí lo que he podido ir armando.

{ ​"jsonrpc": "2.0",

​"method": "call",

​"params": {

​ ​"context": { "uid": 10, "lang": "es_UY" },

​ ​ "model": "account.invoice",

​ ​"method": "create",

​ ​"args": [{

​ ​ ​"partner_id": 1423, // ID del cliente

​ ​ ​"invoice_line_ids": [ [0, 0, {

​ ​ ​ ​"product_id": 112, // ID del producto ​ ​ ​ ​ ​ ​ ​ ​ ​ ​"quantity": 2,

​ ​ ​ ​"name":"prueba json rpc",

​ ​ ​ ​ "price_unit": 50.0 }],

​ ​ ​ ​[0, 0, { "product_id": 113, // ID del segundo producto

​ ​ ​ ​"quantity": 3,

​ ​ ​ ​"name" : "PRUEBA JSON RPC",

​ ​ ​ ​"price_unit": 60.0 }] ] }], //

​ ​ ​"invoice_origin": "Pedido de venta 123", // Nro de pedido de venta

​ ​ ​"invoice_payment_term_id": 1, // Términos de pago

​ ​ ​​ "account_analytic_id": 5, // ID de la cuenta analítica

​ ​ ​"sent": true, "kwargs" : {}
​}

}

0
Avatar
Descartar
Avatar
Mike
Autor Best Answer

English there:

Hello everyone,

I'm trying to create invoices from an external system, so before diving into development, I've decided to document all the endpoints I need to use in Odoo using Postman.

I can already search for customers, create customers, search for products, and create products. However, I'm having trouble creating invoices because I can't find documentation for it.

While looking at the data model gives me some insight, I always encounter a new error. Does anyone have more information on how to create the JSON to be sent via the RPC API for invoice creation?

Here's what I've been able to put together:

[

0
Avatar
Descartar
Mike
Autor

I can made a draft invoice :

URL: https://localhost:8069//web/dataset/call_kw/sale.advance.payment.inv/create

JSON:

{
"jsonrpc":"2.0",
"method":"call",
"params":
{"args":[{
"type":"out_invoice",
"move_name":false,
"user_id":6,
"team_id":1,
"currency_id":2,
"comment":"Factura web",
"journal_id":1,
"company_id":1,
"incoterm_id":false,
"sequence_number_next":false,
"partner_id":1423,
"partner_shipping_id":1423,
"payment_term_id":1,
"cash_rounding_id":false,
"date_invoice":"2023-10-17",
"date_due":"2023-10-17",
"x_contado_credito":"contado",
"x_referencia_manual":false,
"invoice_line_ids":[ //son las lineas de la factura
[0,"virtual_2321",{"sequence":10,"display_type":false,"account_id":111,"quantity":1,"discount":0,"product_id":112,"origin":false,"is_rounding_line":false,"name":"","account_analytic_id":4,"analytic_tag_ids":[[6,false,[]]],"uom_id":1,"price_unit":200,"invoice_line_tax_ids":[[6,false,[3]]],"currency_id":2}]
],
"account_id":6,
"reference":false,
"name":false,
"fiscal_position_id":false,
"origin":false,
"incoterms_id":false,
"partner_bank_id":false,
"tax_line_ids":[
[0,"virtual_2365",{
"analytic_tag_ids":[[6,false,[]]],
"name":"Ventas Exentos IVA",
"tax_id":3,
"account_id":111,
"account_analytic_id":4,
"amount":0,
"amount_rounding":0,
"manual":false,
"sequence":1,
"currency_id":2}]
],
"x_lugar_entrega_mercaderia":false,
"x_referencia_ocompra":false,
"x_rep_impresa_fact":false,
"x_referencia_global":false,
"message_attachment_count":0}
],
"model":"account.invoice",
"method":"create",
"kwargs":{
"context":{"lang":"es_UY","tz":"America/Montevideo","uid":6,"type":"out_invoice","journal_type":"sale"}
}
}
//"id":740910454
}

{
"jsonrpc":"2.0",
"method":"call",
"params":
{"args":[{
"type":"out_invoice",
"move_name":false,
"user_id":6,
"team_id":1,
"currency_id":2,
"comment":"Factura web",
"journal_id":1,
"company_id":1,
"incoterm_id":false,
"sequence_number_next":false,
"partner_id":1423,
"partner_shipping_id":1423,
"payment_term_id":1,
"cash_rounding_id":false,
"date_invoice":"2023-10-17",
"date_due":"2023-10-17",
"x_contado_credito":"contado",
"x_referencia_manual":false,
"invoice_line_ids":[ //son las lineas de la factura
[0,"virtual_2321",{"sequence":10,"display_type":false,"account_id":111,"quantity":1,"discount":0,"product_id":112,"origin":false,"is_rounding_line":false,"name":"","account_analytic_id":4,"analytic_tag_ids":[[6,false,[]]],"uom_id":1,"price_unit":200,"invoice_line_tax_ids":[[6,false,[3]]],"currency_id":2}]
],
"account_id":6,
"reference":false,
"name":false,
"fiscal_position_id":false,
"origin":false,
"incoterms_id":false,
"partner_bank_id":false,
"tax_line_ids":[
[0,"virtual_2365",{
"analytic_tag_ids":[[6,false,[]]],
"name":"Ventas Exentos IVA",
"tax_id":3,
"account_id":111,
"account_analytic_id":4,
"amount":0,
"amount_rounding":0,
"manual":false,
"sequence":1,
"currency_id":2}]
],
"x_lugar_entrega_mercaderia":false,
"x_referencia_ocompra":false,
"x_rep_impresa_fact":false,
"x_referencia_global":false,
"message_attachment_count":0}
],
"model":"account.invoice",
"method":"create",
"kwargs":{
"context":{"lang":"es_UY","tz":"America/Montevideo","uid":6,"type":"out_invoice","journal_type":"sale"}
}
}
//"id":740910454
}

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

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

Registrar-se
Related Posts Respostes Vistes Activitat
How do I know which Model(s), method(s) and field(s) to use when I like to send an invoice (by mail) to the invoicee via the external API?
api invoicing
Avatar
Avatar
1
d’oct. 25
896
Odoo JSON-RPC API
api jsonrpc
Avatar
0
de febr. 25
3180
What is the API endpoint for JSON-RPC?
api jsonrpc
Avatar
0
d’oct. 20
6040
How to add product and its variants with External APIs?
external api
Avatar
0
de febr. 24
4736
jsonrpc bulk write
api odoo jsonrpc
Avatar
Avatar
1
d’abr. 25
2131
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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