Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • E-learning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Artificiële Intelligentie
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelwinkel
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Horeca & Hospitality
    • Bar en café
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van mede-eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brouwerij
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Diensten
    • Klusjesman
    • IT-hardware & ondersteuning
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Alle bedrijfstakken bekijken
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijsprogramma
    • Scale Up! Business Game
    • Odoo bezoeken
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Partner worden
    • Diensten voor partners
    • Registreer je accountantskantoor
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

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

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
whatsapp
2 Antwoorden
376 Weergaven
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
Annuleer
Avatar
Zehntech Technologies Inc.
Beste antwoord

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
Annuleer
Avatar
Vivek Kundaliya
Beste antwoord

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
Annuleer
Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
WhatsApp Campaigns and Bulk Messaging in Odoo
whatsapp
Avatar
Avatar
2
apr. 26
3084
WhatsApp Username Adoption
whatsapp
Avatar
0
apr. 26
1056
When I'm calling someone on WhatsApp and it shows unavailable, what does that mean? Why does it happen?
whatsapp
Avatar
5
aug. 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
aug. 25
3136
send whatsap message to multiple phone numbers Opgelost
whatsapp
Avatar
Avatar
1
jun. 25
3328
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Partner worden
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة 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 is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

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