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

Write function for res.users many2one field in sale_order or crm_lead for few res_users ids is not working. [V-Odoo 10 Community]

Suscribirse

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

Se marcó esta pregunta
communityOdoo10.0
3 Respuestas
4602 Vistas
Avatar
Sumit Sinha

One many2one field in crm_lead and sale_order is corresponding to res_user ids.

When I am selecting one id in res_users where id=52 (related partner present in res.partner where id=43171), it is not getting saved either in lead/opportunity or sales order. But it accepts for other res_user ids in either objects.

When I try to update it using SQL query, either in crm.lead or sale.order it shows error :

ERROR:  insert or update on table "crm_lead" violates foreign key constraint "crm_lead_rep_fkey"

DETAIL:  Key (rep)=(52) is not present in table "res_partner".

********** Error **********


ERROR: insert or update on table "crm_lead" violates foreign key constraint "crm_lead_rep_fkey"

SQL state: 23503

Detail: Key (rep)=(52) is not present in table "res_partner".

When I check the res_partner table, id=52 is not present. But as per query I don't understand the relation with res_partner table, instead the related partner id of Rahul in res.partner is  43171.

Everything remaining same in testing instance, write function is working. (There also id=52 is not present in res_partner, but the record is getting saved here).

So l am confused why write is not happening only in live server and that too for res_user id=52 which has got no relation with res_partner table id=52.

Can anyone help in this ?


Regards

Sumit Sinha

0
Avatar
Descartar
Hilar Andikkadavath

which field is actually you are trying to update?

Avatar
Sumit Sinha
Autor Mejor respuesta

Hi Hilar,

I am trying to update a field present in sale.order and crm.lead and it takes res_user ids. In my case, it is not taking for id=52, but other id it is taking.


Hi Mitul,

When I am not considering res_partner table in that field, why is that id checked into that table. It is of course present in res_user table and my field also correspond to same table.

And how can I save that id=52 in my crm_lead/sale_order.


Regards

Sumit Sinha

0
Avatar
Descartar
Avatar
Mitul Shingala
Mejor respuesta

hello

the problem is the reference for the partner table field is not proper set into the field.

for eg. here you get an error like Key (rep)=(52) is not present in table "res_partner". so it means 52 number id is not present into the table res_partner. and when you write into the field of crm_lead/sale_order table's partner field at that time the id which is you set that is from some another tables not from the res_partner. that's why you get this error. 

0
Avatar
Descartar
¿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
Uncaught Error: QWeb2 - template['XmlReceipt']: Runtime Error: TypeError: Cannot read property 'currency' of undefined POS when printing receipt.
community Point Of Sale Odoo10.0
Avatar
Avatar
1
nov 20
7495
What’s the best architecture to manage multi-tenant odoo community setup with white-label support?
community
Avatar
Avatar
1
oct 25
1120
refresh screen save data automatically
community
Avatar
Avatar
2
jul 24
3381
tax location
community
Avatar
Avatar
2
may 24
8542
can not do invoice in community version
community
Avatar
Avatar
1
feb 24
2836
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.

Sitio web hecho con

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