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
    Food & Hospitality
    • Bar y taberna
    • Restaurante
    • Comida rápida
    • Guest House
    • Distribuidor de bebidas
    • Hotel
    Real Estate
    • Real Estate Agency
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consulting
    • Accounting Firm
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Trades
    • Handyman
    • Hardware y asistencia informática
    • Solar Energy Systems
    • Zapatero
    • Servicios de limpieza
    • HVAC Services
    Others
    • Nonprofit Organization
    • 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

How to attach a Company and Customer to the same Odoo invoice

Suscribirse

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

Se marcó esta pregunta
xmlrpcinvocesnodejs
1 Responder
2419 Vistas
Avatar
Mohammed Fathi

I'm using Nodejs (odoo-xmlrpc lib)to integrate with Odoo.

the customer record has been created and attached correctly to the invoice but when trying to attach a company record as well it is returning an error as described below.


example of code.

const params = [];
params.push({
partner_id:1,
company_id:9,
ref:`order_${order.id}`,
payment_state:'paid',
invoice_line_ids: lineEntries,
move_type:'out_invoice'});
// Create the Invoice
const invoiceId = await this.run('account.move','create',params);

this code returns the following error: 

faultString: 'Record does not exist or has been deleted.\n' +
'(Record: res.company(9,), User: 2)'

but when checking the Odoo dashboard I can see the company is created with ID 9 successfully.


Update: 24 Jan 2023
According to the answer by @S.M Firoz Ahmed
I changed the company creation model from (res.partner with option {is_company:true}) to (res.company). the company and assigned to a journal after creating it by the following code 

params = { 'name': 'My Journal', 'code': 'MJ', 'company_id': 1 } 
const journal_id = models.execute_kw('account.journal', 'create', [params])

and then assigned the company_id and journal_id to the invoice

const invoiceParams ={
partner_id:customer.id,
journal_id:2,company_id:1,
ref:`order_123`,
payment_state:'paid',
invoice_line_ids:lineEntries,
move_type:'out_invoice'
}
invoice_id = models.execute_kw('account.move', 'create', [params])

but nothing new, the same error returned 

0
Avatar
Descartar
Avatar
S.M Firoz Ahmed ( Daffodil Software Limited )
Mejor respuesta

It appears that the error is occurring when you are trying to attach a company record to the invoice. The error message suggests that the record with ID 9 in the "res.company" model does not exist or has been deleted. However, you have confirmed that the company record with ID 9 is present in the Odoo dashboard.

Here are a few things you can check to troubleshoot the issue:

  1. Verify that the "company_id" field is correctly defined as a many2one field in the "account.move" model and that it is correctly linked to the "res.company" model.

  2. Make sure that the user that you are using to create the invoice has the appropriate permissions to access and modify the "res.company" model and the specific record with ID 9.

  3. Confirm that the company record with ID 9 is in the correct state and has not been archived or deleted.

  4. Check that you're passing correct values to all the fields, especially the required fields.

  5. Check that you're passing the correct context.

  6. Make sure that the company_id is present in the create method of account.move

2
Avatar
Descartar
Mohammed Fathi
Autor

Thank you for answering, can you please check my question again since I update it according to your answer

¿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
check if user exists in odoo database
xmlrpc nodejs
Avatar
Avatar
2
sept 22
4428
xmlrpc Error when attempting to connect to my local instance Resuelto
xmlrpc
Avatar
Avatar
Avatar
3
jul 25
4157
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
oct 24
3019
How to run a method from external api as the superuser
xmlrpc
Avatar
Avatar
1
abr 24
3093
mail.message Attachment through XMLRPC Resuelto
attachment xmlrpc helpdesk comment nodejs
Avatar
Avatar
2
may 24
3745
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