Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita 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
  • Proyectos
  • 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
2429 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.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
check if user exists in odoo database
xmlrpc nodejs
Avatar
Avatar
2
sept 22
4438
xmlrpc Error when attempting to connect to my local instance Resuelto
xmlrpc
Avatar
Avatar
Avatar
3
jul 25
4172
Cannot marshal None unless allow_none is enabled
xmlrpc
Avatar
1
oct 24
3030
How to run a method from external api as the superuser
xmlrpc
Avatar
Avatar
1
abr 24
3101
mail.message Attachment through XMLRPC Resuelto
attachment xmlrpc helpdesk comment nodejs
Avatar
Avatar
2
may 24
3752
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • 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 estar 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