Se rendre au contenu
Odoo Menu
  • Se connecter
  • Essai gratuit
  • Applications
    Finance
    • Comptabilité
    • Facturation
    • Notes de frais
    • Feuilles de calcul (BI)
    • Documents
    • Signature
    Ventes
    • CRM
    • Ventes
    • PdV Boutique
    • PdV Restaurant
    • Abonnements
    • Location
    Sites web
    • Site Web
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Chaîne d'approvisionnement
    • Inventaire
    • Fabrication
    • PLM
    • Achats
    • Maintenance
    • Qualité
    Ressources Humaines
    • Employés
    • Recrutement
    • Congés
    • Évaluations
    • Recommandations
    • Parc automobile
    Marketing
    • Marketing Social
    • E-mail Marketing
    • SMS Marketing
    • Événements
    • Marketing Automation
    • Sondages
    Services
    • Projet
    • Feuilles de temps
    • Services sur Site
    • Assistance
    • Planification
    • Rendez-vous
    Productivité
    • Discussion
    • Intelligence artificielle
    • Internet des Objets
    • VoIP
    • Connaissances
    • WhatsApp
    Applications tierces Odoo Studio Plateforme Cloud d'Odoo
  • Industries
    Commerce de détail
    • Librairie
    • Magasin de vêtements
    • Magasin de meubles
    • Supermarché
    • Quincaillerie
    • Magasin de jouets
    Restauration & Hôtellerie
    • Bar et Pub
    • Restaurant
    • Fast-food
    • Maison d’hôtes
    • Distributeur de boissons
    • Hôtel
    Immobilier
    • Agence immobilière
    • Cabinet d'architecture
    • Construction
    • Gestion immobilière
    • Jardinage
    • Association de copropriétaires
    Consultance
    • Cabinet d'expertise comptable
    • Partenaire Odoo
    • Agence Marketing
    • Cabinet d'avocats
    • Aquisition de talents
    • Audit & Certification
    Fabrication
    • Textile
    • Métal
    • Meubles
    • Alimentation
    • Brasserie
    • Cadeaux d'entreprise
    Santé & Fitness
    • Club de sports
    • Opticien
    • Salle de fitness
    • Praticiens bien-être
    • Pharmacie
    • Salon de coiffure
    Commerce
    • Homme à tout faire
    • Matériel informatique & support
    • Systèmes photovoltaïques
    • Cordonnier
    • Services de nettoyage
    • Services CVC
    Autres
    • Organisation à but non lucratif
    • Agence environnementale
    • Location de panneaux d'affichage
    • Photographie
    • Leasing de vélos
    • Revendeur de logiciel
    Parcourir toutes les industries
  • Communauté
    Apprenez
    • Tutoriels
    • Documentation
    • Certifications
    • Formation
    • Blog
    • Podcast
    Renforcer l'éducation
    • Programme éducatif
    • Business Game Scale-Up!
    • Rendez-nous visite
    Obtenir le logiciel
    • Téléchargement
    • Comparez les éditions
    • Versions
    Collaborer
    • Github
    • Forum
    • Événements
    • Traductions
    • Devenir partenaire
    • Services pour partenaires
    • Enregistrer votre cabinet comptable
    Nos Services
    • Trouver un partenaire
    • Trouver un comptable
    • Rencontrer un conseiller
    • Services de mise en œuvre
    • Références clients
    • Assistance
    • Mises à niveau
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obtenir une démonstration
  • Tarification
  • Aide
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Vous devez être inscrit pour interagir avec la communauté.
Toutes les publications Personnes Badges
Étiquettes (Voir toutl)
odoo accounting v14 pos v15
À propos de ce forum
Aide

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

S'inscrire

Recevez une notification lorsqu'il y a de l'activité sur ce poste

Cette question a été signalée
whatsapp
2 Réponses
374 Vues
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
Ignorer
Avatar
Zehntech Technologies Inc.
Meilleure réponse

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
Ignorer
Avatar
Vivek Kundaliya
Meilleure réponse

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
Ignorer
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !

Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !

S'inscrire
Publications associées Réponses Vues Activité
WhatsApp Campaigns and Bulk Messaging in Odoo
whatsapp
Avatar
Avatar
2
avr. 26
3082
WhatsApp Username Adoption
whatsapp
Avatar
0
avr. 26
1055
When I'm calling someone on WhatsApp and it shows unavailable, what does that mean? Why does it happen?
whatsapp
Avatar
5
août 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
août 25
3135
send whatsap message to multiple phone numbers Résolu
whatsapp
Avatar
Avatar
1
juin 25
3328
Communauté
  • Tutoriels
  • Documentation
  • Forum
Open Source
  • Téléchargement
  • Github
  • Runbot
  • Traductions
Services
  • Hébergement Odoo.sh
  • Assistance
  • Migration
  • Développements personnalisés
  • Éducation
  • Trouver un comptable
  • Trouver un partenaire
  • Devenir partenaire
À propos
  • Notre société
  • Actifs de la marque
  • Contactez-nous
  • Emplois
  • Événements
  • Podcast
  • Blog
  • Clients
  • Informations légales • Confidentialité
  • Sécurité.
الْعَرَبيّة 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 est une suite d'applications open source couvrant tous les besoins de votre entreprise : CRM, eCommerce, Comptabilité, Inventaire, Point de Vente, Gestion de Projet, etc.

Le positionnement unique d'Odoo est d'être à la fois très facile à utiliser et totalement intégré.

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