Skip to Content
Odoo Menu
  • Prihlásiť sa
  • Vyskúšajte zadarmo
  • Aplikácie
    Financie
    • Účtovníctvo
    • Fakturácia
    • Výdavky
    • Tabuľka (BI)
    • Dokumenty
    • Podpis
    Predaj
    • CRM
    • Predaj
    • POS Shop
    • POS Restaurant
    • Manažment odberu
    • Požičovňa
    Webstránky
    • Tvorca webstránok
    • eShop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Supply Chain
    • Sklad
    • Výroba
    • Správa životného cyklu produktu
    • Nákup
    • Údržba
    • Manažment kvality
    Ľudské zdroje
    • Zamestnanci
    • Nábor zamestnancov
    • Voľné dni
    • Hodnotenia
    • Odporúčania
    • Vozový park
    Marketing
    • Marketing sociálnych sietí
    • Email marketing
    • SMS marketing
    • Eventy
    • Marketingová automatizácia
    • Prieskumy
    Služby
    • Projektové riadenie
    • Pracovné výkazy
    • Práca v teréne
    • Helpdesk
    • Plánovanie
    • Schôdzky
    Produktivita
    • Tímová komunikácia
    • Schvalovania
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Priemyselné odvetvia
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Reštaurácia
    • Fast Food
    • Guest House
    • Beverage distributor
    • Hotel
    Reality
    • Real Estate Agency
    • Architecture Firm
    • Konštrukcia
    • Estate Managament
    • Gardening
    • Property Owner Association
    Poradenstvo
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Jedlo
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware and Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Iní
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Komunita
    Vzdelávanie
    • Tutoriály
    • Dokumentácia
    • Certifikácie
    • Školenie
    • Blog
    • Podcast
    Empower Education
    • Vzdelávací program
    • Scale Up! Business Game
    • Visit Odoo
    Softvér
    • Stiahnuť
    • Porovnanie Community a Enterprise vierzie
    • Releases
    Spolupráca
    • Github
    • Fórum
    • Eventy
    • Preklady
    • Staň sa partnerom
    • Services for Partners
    • Register your Accounting Firm
    Služby
    • Nájdite partnera
    • Nájdite účtovníka
    • Meet an advisor
    • Implementation Services
    • Zákaznícke referencie
    • Podpora
    • Upgrades
    ​Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Získajte demo
  • Cenník
  • Pomoc

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Účtovníctvo
  • Sklady
  • PoS
  • Projektové riadenie
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tagy (View all)
odoo accounting v14 pos v15
About this forum
Pomoc

Webhook Target Record for a new record

Odoberať

Get notified when there's activity on this post

This question has been flagged
recordWebhookTarget
7 Replies
5002 Zobrazenia
Avatar
Laurent Appels

I am creating a webhook that imports customer data from a CSV.

I am fairly new to this as this was recently added to Odoo 17 as a standard feature.

I have seen multi good videos etc and how to setup the automation rules.

However, all samples I see are about changing a record. What I am struggling what if what will the Target record code be for a new record and not a get.id code for an existing record. 

2
Avatar
Zrušiť
Niyas Raphy (Walnut Software Solutions)

To create new record using webhook: https://www.youtube.com/watch?v=D3urHJ9rB2o

Avatar
Yenthe Van Ginneken (Mainframe Monkey)
Best Answer

Hi Laurent,

I happend to have the exact same usecase as you.
We want to trigger webhooks from a remote system to create a new record instead of updating existing records.
After digging in the core code from Odoo (https://github.com/odoo/odoo/blob/ad299c9325e0a0faf18ba8b2709d4be2829b7158/addons/base_automation/models/base_automation.py#L473-L516) I found out that Odoo in fact simply doesn't support it.. *shrugs*

I've opened a pull request (code change) that serves as a basis to discuss a possible solution for this in the core. You can view it at https://github.com/odoo/odoo/pull/154408

Regards,
Yenthe

1
Avatar
Zrušiť
Laurent Appels
Autor

Thanks Yenthe,
You are obviously much more familiar with this coding. However what you are saying, Create record through webhook, get the new record ID and the fill this record with data is exactly what I as novice expected already to be in place. Hopefully soon.

Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

Hi,

To create new record using webhook, see the method explained here:  Create a New Record Using Webhook in Odoo 17

Thanks

0
Avatar
Zrušiť
Avatar
Breanne Schumm
Best Answer

Use this odoo plugin to send or receive data from external website

Odoo Store Plugin: "odoo_dynamic_webhooks".

0
Avatar
Zrušiť
Avatar
NexonBytes
Best Answer

Use this odoo plugin to send or receive data from external website

Odoo Store Plugin: "odoo_dynamic_webhooks"

0
Avatar
Zrušiť
Avatar
Houssem Eddine Selmi
Best Answer

Hi does anyone have answer to this pls? 

0
Avatar
Zrušiť
Niyas Raphy (Walnut Software Solutions)

To create record using webhook: https://www.youtube.com/watch?v=D3urHJ9rB2o

Avatar
Ryley Sevier
Best Answer

+1 to trying to figure this out too.

I tried creating a new record in the Target Record field with 

env['crm.lead'].create({'name': payload['name': 'foo']})

but it looks like this happens in a safety evaluation here. I'm not sure what that entails yet but that throws many errors I haven't decided to look into yet.

It also looks like it's not bringing in the env variable like it says it is right above it or I'm not accessing it correctly. I feel like env['crm.leads']​ shouldn't come back with an error that env is undefined.

I tried selecting a dummy record statically and then creating it in my Execute Code block too but that's causing all kinds of 500 page dead errors:

env['crm.lead'].create({
    'name': "FooBar",
    "user_id": 2
})

But this kicks back a 'dict' object has no attribute 'name'​ error from ir.logging when I wrap it in an except block. 

0
Avatar
Zrušiť
Niyas Raphy (Walnut Software Solutions)

To create record using webhook: https://www.youtube.com/watch?v=D3urHJ9rB2o

Avatar
Ray Carnes (ray)
Best Answer

Have you seen this, which covers sending and receiving records:


0
Avatar
Zrušiť
Laurent Appels
Autor

Thanks Ray, I know this video inside out already. While I certainly recommend it for anyone starting with Webhooks, it does not address the core issue I am facing. The sample shows also use update records etc, there is no example worked out to create a record.
In odoo the Target record field needs to be filled in. However what do I need to fill in there since the"target" record does not exist yet but I want it to be created.

Ray Carnes (ray)

See https://www.odoo.com/forum/help-1/webhooks-how-do-i-create-a-new-record-251551

Niyas Raphy (Walnut Software Solutions)

To create record using webhook: https://www.youtube.com/watch?v=D3urHJ9rB2o

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrácia
Related Posts Replies Zobrazenia Aktivita
Webhook - create CRM lead working example please
Webhook
Avatar
0
júl 24
2046
How to connect external data to contacts via webhook?
Webhook
Avatar
Avatar
Avatar
Avatar
4
mar 24
4263
In Report module when we create own Footer giving error
record
Avatar
2
jún 16
4021
(Odoo 8) Access rights to project.task
record
Avatar
Avatar
3
jan 16
5459
Multiple models data in webhook
models Webhook
Avatar
0
dec 24
1215
Komunita
  • Tutoriály
  • Dokumentácia
  • Fórum
Open Source
  • Stiahnuť
  • Github
  • Runbot
  • Preklady
Služby
  • Odoo.sh hosting
  • Podpora
  • Vyššia verzia
  • Custom Developments
  • Vzdelávanie
  • Nájdite účtovníka
  • Nájdite partnera
  • Staň sa partnerom
O nás
  • Naša spoločnosť
  • Majetok značky
  • Kontaktujte nás
  • Pracovné ponuky
  • Eventy
  • Podcast
  • Blog
  • Zákazníci
  • Právne dokumenty • Súkromie
  • Bezpečnosť
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo je sada podnikových aplikácií s otvoreným zdrojovým kódom, ktoré pokrývajú všetky potreby vašej spoločnosti: CRM, e-shop, účtovníctvo, skladové hospodárstvo, miesto predaja, projektový manažment atď.

Odoo prináša vysokú pridanú hodnotu v jednoduchom použití a súčasne plne integrovanými biznis aplikáciami.

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