Sari la conținut
Odoo Meniu
  • Autentificare
  • Try it free
  • Aplicații
    Finanțe
    • Contabilitate
    • Facturare
    • Cheltuieli
    • Spreadsheet (BI)
    • Documente
    • Semn
    Vânzări
    • CRM
    • Vânzări
    • POS Shop
    • POS Restaurant
    • Abonamente
    • Închiriere
    Site-uri web
    • Constructor de site-uri
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Lanț Aprovizionare
    • Inventar
    • Producție
    • PLM
    • Achiziție
    • Maintenance
    • Calitate
    Resurse Umane
    • Angajați
    • Recrutare
    • Time Off
    • Evaluări
    • Referințe
    • Flotă
    Marketing
    • Social Marketing
    • Marketing prin email
    • SMS Marketing
    • Evenimente
    • Automatizare marketing
    • Sondaje
    Servicii
    • Proiect
    • Foi de pontaj
    • Servicii de teren
    • Centru de asistență
    • Planificare
    • Programări
    Productivitate
    • Discuss
    • Artificial Intelligence
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Aplicații Terțe Odoo Studio Platforma Odoo Cloud
  • Industrii
    Retail
    • Book Store
    • Magazin de îmbrăcăminte
    • Magazin de Mobilă
    • Magazin alimentar
    • Magazin de materiale de construcții
    • Magazin de jucării
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Distribuitor de băuturi
    • Hotel
    Proprietate imobiliara
    • Real Estate Agency
    • Firmă de Arhitectură
    • Construcție
    • Property Management
    • Grădinărit
    • Asociația Proprietarilor de Proprietăți
    Consultanta
    • Firma de Contabilitate
    • Partener Odoo
    • Agenție de marketing
    • Law firm
    • Atragere de talente
    • Audit & Certification
    Producție
    • Textil
    • Metal
    • Mobilier
    • Mâncare
    • Brewery
    • Cadouri corporate
    Health & Fitness
    • Club Sportiv
    • Magazin de ochelari
    • Centru de Fitness
    • Wellness Practitioners
    • Farmacie
    • Salon de coafură
    Trades
    • Handyman
    • IT Hardware and Support
    • Asigurare socială de stat
    • Cizmar
    • Servicii de curățenie
    • HVAC Services
    Altele
    • Organizație nonprofit
    • Agenție de Mediu
    • Închiriere panouri publicitare
    • Fotografie
    • Închiriere biciclete
    • Asigurare socială
    Browse all Industries
  • Comunitate
    Învăță
    • Tutorials
    • Documentație
    • Certificări
    • Instruire
    • Blog
    • Podcast
    Empower Education
    • Program Educațional
    • Scale Up! Business Game
    • Visit Odoo
    Obține Software-ul
    • Descărcare
    • Compară Edițiile
    • Lansări
    Colaborați
    • Github
    • Forum
    • Evenimente
    • Translations
    • Devino Partener
    • Services for Partners
    • Înregistrează-ți Firma de Contabilitate
    Obține Servicii
    • Găsește un Partener
    • Găsiți un contabil
    • Meet an advisor
    • Servicii de Implementare
    • Referințe ale clienților
    • Suport
    • Actualizări
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Obține un demo
  • Prețuri
  • Ajutor
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Toate postările Oameni Insigne
Etichete (Vezi tot)
odoo accounting v14 pos v15
Despre acest forum
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Toate postările Oameni Insigne
Etichete (Vezi tot)
odoo accounting v14 pos v15
Despre acest forum
Suport

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

Abonare

Primiți o notificare când există activitate la acestă postare

Această întrebare a fost marcată
developmentmessage
1 Răspunde
1040 Vizualizări
Imagine profil
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
Imagine profil
Abandonează
Imagine profil
Kunjan Patel
Cel mai bun răspuns
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
Imagine profil
Abandonează
Îți place discuția? Nu doar citi, alătură-te!

Creează-ți un cont astăzi pentru a beneficia de funcții exclusive și a interacționa cu minunata noastră comunitate!

Înscrie-te
Postări similare Răspunsuri Vizualizări Activitate
Odoo Chatter Edit/Create Permissions With Only Model Read
development message
Imagine profil
Imagine profil
1
apr. 26
1252
How to programmatically set ALL 4 Template Variables in whatsapp.composer (SaaS 19.1)? Rezolvat
development message
Imagine profil
Imagine profil
2
mar. 26
1261
error en Whatsapp.composer
development message
Imagine profil
Imagine profil
1
mar. 26
963
How to programmatically trigger a WhatsApp Template send in Odoo SaaS 19.1? Rezolvat
development message
Imagine profil
Imagine profil
1
mar. 26
1148
Livechat Offline Operator
development message
Imagine profil
0
apr. 25
2270
Comunitate
  • Tutorials
  • Documentație
  • Forum
Open Source
  • Descărcare
  • Github
  • Runbot
  • Translations
Servicii
  • Hosting Odoo.sh
  • Suport
  • Actualizare
  • Custom Developments
  • Educație
  • Găsiți un contabil
  • Găsește un Partener
  • Devino Partener
Despre Noi
  • Compania noastră
  • Active de marcă
  • Contactați-ne
  • Locuri de muncă
  • Evenimente
  • Podcast
  • Blog
  • Clienți
  • Aspecte juridice • Confidențialitate
  • Securitate
الْعَرَبيّة 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 este o suită de aplicații de afaceri open source care acoperă toate nevoile companiei dvs.: CRM, comerț electronic, contabilitate, inventar, punct de vânzare, management de proiect etc.

Propunerea de valoare unică a Odoo este să fie în același timp foarte ușor de utilizat și complet integrat.

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