Ir al contenido
Odoo Menú
  • Inicia 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
    • Inteligencia artificial
    • 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 propiedades
    • 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
  • Comunidad
    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
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

[BUG] WhatsApp Template - TypeError: object of type 'LocalBinaryFile' has no len() | saas-19.3

Suscribirse

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

Se marcó esta pregunta
whatsapp
2 Respuestas
383 Vistas
Avatar
neelam@digimonk.in
Hi,

Getting this error when submitting a WhatsApp Template with Header Type = Document:

TypeError: object of type 'LocalBinaryFile' has no len()

File: whatsapp/tools/whatsapp_api.py, line 196, in _upload_demo_document
data=attachment.raw is passed to requests but LocalBinaryFile has no __len__()
so urllib3 crashes during chunked upload.

Version: Odoo Enterprise saas-19.3 (Odoo Online)

Steps:
1. WhatsApp → Templates → New
2. Header Type = Document → upload file
3. Submit for Approval → crash

Workaround: Switching Header Type to Text works but Document headers
are a valid Meta feature.

Suggested fix: read bytes before passing →
file_data = attachment.raw.read()
then pass data=file_data with Content-Length header.

Is there a patch available? Thanks!
0
Avatar
Descartar
Avatar
Zehntech Technologies Inc.
Mejor respuesta

Hello, 

Based on the traceback and your analysis, this does appear to be a bug in the WhatsApp template submission flow for Document headers in saas-19.3 rather than a configuration issue.

Since you're using Odoo Online, custom patches cannot be applied directly. If this issue is reproducible on a standard database, the recommended approach is to raise a support ticket with Odoo and provide the reproduction steps along with the traceback details.

Your proposed workaround (using a Text header) is valid for now, and the suggested code change also seems consistent with the root cause you identified. However, any permanent fix would need to come from Odoo's official SaaS codebase.

Hope this works for you! If you need any help implementing this or want a more optimized approach, feel free to reach out for further discussion.

Regards,

Zehntech Technologies Inc.

santosh.sekwadia@zehntech.com

0
Avatar
Descartar
Avatar
Vivek Kundaliya
Mejor respuesta

This is a known bug in saas-19.3 where attachment.raw returns a LocalBinaryFile object (not raw bytes), causing urllib3 to fail because it cannot determine the content length.


**Immediate Workaround (no code needed):**

Use a URL-based document header instead of a file upload:

  • In your WhatsApp Template, set Header Type = Document

Enter a public URL to your document instead of uploading a file

  • This bypasses the _upload_demo_document method entirely

**For Odoo Online (saas-19.3 Enterprise):**

Since you cannot modify server files directly:

  1. Submit a bug report to Odoo Support through your Enterprise subscription portal - this is a server-side bug they should hotfix
  2. 2. Use the URL workaround above in the meantime
  3. 3. Switch to Text header type for your templates until the patch is deployed

**Technical Root Cause:**

The bug is in whatsapp/tools/whatsapp_api.py where data=attachment.raw is passed directly. The fix would be reading the bytes first with attachment.raw.read() but on Odoo Online you cannot apply this patch yourself. This is Odoo's bug to fix.


Hope this helps - please upvote so Odoo prioritizes the fix!

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
WhatsApp Campaigns and Bulk Messaging in Odoo
whatsapp
Avatar
Avatar
2
abr 26
3090
WhatsApp Username Adoption
whatsapp
Avatar
0
abr 26
1068
When I'm calling someone on WhatsApp and it shows unavailable, what does that mean? Why does it happen?
whatsapp
Avatar
5
ago 25
271293
I am getting an error in some area codes that cannot send Whatsapp, although the number searched is still a correct WA account. Is there any solution to help me?
whatsapp
Avatar
Avatar
1
ago 25
3145
send whatsap message to multiple phone numbers Resuelto
whatsapp
Avatar
Avatar
1
jun 25
3347
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 Svenska ภาษาไทย 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