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

SaaS 19.1: whatsapp.composer ignores variable updates via Server Action (Sends "Sample Value" instead)

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
developmentmessage
1 Beantwoorden
1038 Weergaven
Avatar
Brissa Cx, Eliana Bermudez

Hi everyone,

I'm facing a very specific issue in Odoo SaaS 19.1. I am trying to automate a WhatsApp template send from a Server Action.

The Problem: Even though I can trigger the send using action_send_whatsapp_template(), the message always arrives with "Sample Value" for all variables, ignoring the values I've tried to inject via Python.

What I've tried:

  1. Creating the composer with with_context(active_model='crm.lead', active_ids=record.ids).

  2. Updating variables after creation using composer.write({'wa_variable_ids': [(1, var_id, {'value': 'my_data'})]}).

  3. The Server Action logs "Success", but the actual WhatsApp sent to the phone doesn't reflect the changes.

My code snippet:

Python

template = env['whatsapp.template'].search([('name', '=', 'my_template')], limit=1)
composer = env['whatsapp.composer'].with_context(active_model='crm.lead', active_ids=record.ids).create({
    'res_model': 'crm.lead',
    'res_ids': str(record.ids),
    'wa_template_id': template.id
})

# Logic to update variables...
updates = [(1, var.id, {'value': 'Real Data'}) for var in composer.wa_variable_ids]
composer.write({'wa_variable_ids': updates})

# Triggering the send
composer.action_send_whatsapp_template()

My Question: In SaaS 19.1, is there a mandatory method to call (like a _compute or a specific flush) to ensure the wa_variable_ids are committed before action_send_whatsapp_template is executed? Or should I be using a different method to trigger the send that actually processes the composer's current state?

0
Avatar
Annuleer
Avatar
Kunjan Patel
Beste antwoord
Hello Eliana Bermudez,
I hope you are doing well

wa_variable_ids doesn't exist on whatsapp.composer. 
Use free_text_1, free_text_2, field etc. instead:

composer = env['whatsapp.composer'].with_context(active_model='crm.lead', active_id=record.id).create({
      'res_model': 'crm.lead',
      'res_ids': str(record.ids),
      'wa_template_id': template.id,
      'free_text_1': record.partner_id.name,
      'free_text_2': str(record.expected_revenue),
  })
composer._send_whatsapp_template()

change your template variable type from free_text → field and map it to the record field. Then it works automatically with no code fix needed.

I hope this information helps you

Thanks & Regards,
Kunjan Patel
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
Odoo Chatter Edit/Create Permissions With Only Model Read
development message
Avatar
Avatar
1
apr. 26
1252
How to programmatically set ALL 4 Template Variables in whatsapp.composer (SaaS 19.1)? Opgelost
development message
Avatar
Avatar
2
mrt. 26
1259
error en Whatsapp.composer
development message
Avatar
Avatar
1
mrt. 26
962
How to programmatically trigger a WhatsApp Template send in Odoo SaaS 19.1? Opgelost
development message
Avatar
Avatar
1
mrt. 26
1146
Livechat Offline Operator
development message
Avatar
0
apr. 25
2270
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