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][HELPDESK] CREAT A NEW TICKET WITH A WEBHOOK

Odoberať

Get notified when there's activity on this post

This question has been flagged
helpdeskWebhook
2 Replies
3952 Zobrazenia
Avatar
Stefano Zambrano

I´m trying to create a new ticket, with information of a webhook, I verify that I just neet the field name to create, in logs I don't have any mistake. I saw this helpful video and I can create new contacts but I can't create the ticket https://www.youtube.com/watch?v=D3urHJ9rB2o

Payload

​Webhook #82 triggered with payload {'name': 'NAME OF HELPDESK TICKET FROM ​ ​WEBHOOK'}


Python code
vals = {'name': payload.get('name')  }
env['helpdesk.ticket'].create(vals)


Target record field: []


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

Hi,
Set target record as:  model.search([], limit=1) and model as automation rule and try.

Update:
there were a bug in the core and it has been resolved and now you will be able to create the ticket without any issues.

FIX: [FIX] base_automation: prevent crash when writing on tracked fields



Create record using webhook:  https://www.youtube.com/watch?v=D3urHJ9rB2o&t=34s


Thanks

0
Avatar
Zrušiť
Avatar
Stefano Zambrano
Autor Best Answer

Yes i tried it, like the video, model is set as automation rule, but if i set target record as:  model.search([], limit=1), I have the following mistake in logs:

Webhook #82 failed with error:


Traceback (most recent call last):

  File "/home/odoo/src/odoo/17.0/odoo/models.py", line 5854, in ensure_one

    _id, = self._ids

ValueError: not enough values to unpack (expected 1, got 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/odoo/src/odoo/17.0/odoo/tools/safe_eval.py", line 391, in safe_eval

    return unsafe_eval(c, globals_dict, locals_dict)

  File "ir.actions.server(1416,)", line 24, in

  File "", line 2, in create

  File "/home/odoo/src/odoo/17.0/odoo/api.py", line 414, in _model_create_multi

    return create(self, [arg])

  File "/home/odoo/src/enterprise/17.0/helpdesk_sms/models/helpdesk_ticket.py", line 17, in create

    tickets = super().create(vals_list)

  File "", line 2, in create

  File "/home/odoo/src/odoo/17.0/odoo/api.py", line 415, in _model_create_multi

    return create(self, arg)

  File "/home/odoo/src/enterprise/17.0/helpdesk/models/helpdesk_ticket.py", line 493, in create

    tickets = super(HelpdeskTicket, self).create(list_value)

  File "", line 2, in create

  File "/home/odoo/src/odoo/17.0/odoo/api.py", line 415, in _model_create_multi

    return create(self, arg)

  File "/home/odoo/src/odoo/17.0/addons/mail/models/mail_thread.py", line 285, in create

    thread.sudo().message_post(subtype_id=subtype.id, author_id=self.env.user.partner_id.id)

  File "/home/odoo/src/odoo/17.0/addons/sms/models/mail_thread.py", line 135, in message_post

    return super().message_post(*args, body=body, message_type=message_type, **kwargs)

  File "/home/odoo/src/odoo/17.0/addons/rating/models/mail_thread.py", line 178, in message_post

    message = super(MailThread, self).message_post(**kwargs)

  File "/home/odoo/src/odoo/17.0/addons/mail/models/mail_thread.py", line 2136, in message_post

    if self.env.user._is_public() and guest:

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/res_users.py", line 1156, in _is_public

    self.ensure_one()

  File "/home/odoo/src/odoo/17.0/odoo/models.py", line 5857, in ensure_one

    raise ValueError("Expected singleton: %s" % self)

ValueError: Expected singleton: res.users()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

  File "/home/odoo/src/odoo/17.0/addons/base_automation/models/base_automation.py", line 509, in _execute_webhook

    return self._process(record)

  File "/home/odoo/src/odoo/17.0/addons/base_automation/models/base_automation.py", line 671, in _process

    action.with_context(**ctx).run()

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_actions.py", line 941, in run

    res = runner(run_self, eval_context=eval_context)

  File "/home/odoo/src/odoo/17.0/addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi

    res = super(ServerAction, self)._run_action_code_multi(eval_context)

  File "/home/odoo/src/odoo/17.0/odoo/addons/base/models/ir_actions.py", line 771, in _run_action_code_multi

    safz_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self))  # nocopy allows to return 'action'

  File "/home/odoo/src/odoo/17.0/odoo/tools/safe_eval.py", line 405, in safe_eval

    raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))

ValueError: : "Expected singleton: res.users()" while evaluating

"# Available variables:\n#  - env: environment on which the action is triggered\n#  - model: model of the record on which the action is triggered; is a void recordset\n#  - record: record on which the action is triggered; may be void\n#  - records: recordset of all records on which the action is triggered in multi-mode; may be void\n#  - time, datetime, dateutil, timezone: useful Python libraries\n#  - float_compare: utility function to compare floats based on specific precision\n#  - log: log(message, level='info'): logging function to record debug information in ir.logging table\n#  - _logger: _logger.info(message): logger to emit messages in server logs\n#  - UserError: exception class for raising user-facing warning messages\n#  - Command: x2many commands namespace\n# To return an action, assign: action = {...}\n\n\n# Datos del payload\nvals = {\n    'name': payload.get('name')  # Obtiene el nombre del payload\n    #'x_studio_selection_field_1ki_1hl8rqemp':'status1'\n\n}\n\n# Crea el ticket en el modelo helpdesk.ticket\n#env['helpdesk.ticket'].create(vals),\nenv['helpdesk.ticket'].create(vals)"

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

resolved the issue in odoo and now all will be fine

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
¿Cómo puedo hablar con una persona en Aeroméxico 4718?
helpdesk
Avatar
0
nov 25
3
Sales Order and Invoice Warning Messages in Helpdesk Solved
helpdesk
Avatar
Avatar
1
aug 25
983
Support Process Blueprint functionality in Odoo (Same as Zoho desk Blueprint) | Odoo v17
helpdesk
Avatar
0
mar 25
2404
Update custom field after email is received in helpdesk
helpdesk
Avatar
0
okt 24
2399
Odoo is creating tickets for me with old emails Solved
helpdesk
Avatar
Avatar
1
sep 24
2469
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