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

Problem with @api.model_create_multi on res.partner in odoo.sh, Odoo 16

Suscribirse

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

Se marcó esta pregunta
ORModoo16features
2 Respuestas
4072 Vistas
Avatar
ABDOU NASSER

As we all know, @api.model_create_multi allows us to insert or create values at once from a list, instead of doing it one by one. As example, if we have:

values = [{...}, {...}]

Doing

record.create(values)

is better than

for val in values:
    record.create(val)

The other thing to take into consideration is that regarding the res.partner model, everywhere there is a create() method, it has the decorator @api.model_create_multi which allows us to pass a list of values to res.partner when we want to create records.

Now, the problem we are facing (only in odoo.sh) is that we are creating some partners from some data we take to another system via a connector. Those data are coming fine, and we have a list of all required data we are passing to the create().

If we have 5 contacts, the action we are calling will create only one contact and then one other, and then another one, etc... but in our local it's working fine, all the 5 contacts are created at once.

Here is the code: https://gist.github.com/nasser-bloopark/dfe8c5b42d6f2bd84ae37aafc0e4f468

After some investigations, we found that the issue is in the line destination_model.create(create_values).

Note that we didn't override the method create() anywhere, and we are using the OCA module partner_firstname as dependency to this custom module.

So, my question is: is there something I missed here or some other tips we can use from the ORM to fix this issue ?

0
Avatar
Descartar
Avatar
Stanislas Gueniffey (stgu)
Mejor respuesta

Hello Abdou Nasser,
May I recommend to open a ticket ?
The code you provide seems unrelated to the issue you describe. As you expect since you say the problem only occurs in odoo.sh. Therefore it's hard to debug something like this.

Generally speaking, I would expect records to be created one by one if there's inter-dependency among the created records or if a sequence is used in their creation.

Also generally speaking, your odoo.sh instance may have less resources, for example less available threads.

I see the module partner_firstname does override the create() method, but if it works properly in local that shouldn't be the issue.

0
Avatar
Descartar
ABDOU NASSER
Autor

Thank you Stanislas Gueniffey
I have contacted the odoo support and waiting
For now, i have put the create() in the for loop

Avatar
Pedro M. Baeza
Mejor respuesta

Check if any of the code you have in the instance is overwriting the create method of res.partner and mangling the super calling.

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
DeprecationWarning: The longpolling-port is a deprecated alias to the gevent-port option, please use the latter Resuelto
odoo16features
Avatar
Avatar
Avatar
Avatar
Avatar
5
sept 25
25484
How to Add wizard under print button inside the form view.
odoo16features
Avatar
Avatar
Avatar
Avatar
3
ago 25
3878
How to add @api.onchange in _get_view() method odoo 16
odoo16features
Avatar
Avatar
1
may 25
3778
get all partners which are internal users or portal users odoo16
odoo16features
Avatar
Avatar
1
abr 25
4621
How to add decoration color green with bold to a record with a single conditon
odoo16features
Avatar
Avatar
1
abr 25
5441
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