Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

[WEBHOOK][HELPDESK] CREAT A NEW TICKET WITH A WEBHOOK

Subscribe

Get notified when there's activity on this post

This question has been flagged
helpdeskWebhook
2 Replies
3951 Views
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
Discard
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
Discard
Avatar
Stefano Zambrano
Author 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
Discard
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!

Sign up
Related Posts Replies Views Activity
¿Cómo puedo hablar con una persona en Aeroméxico 4718?
helpdesk
Avatar
0
नव॰ 25
3
Sales Order and Invoice Warning Messages in Helpdesk Solved
helpdesk
Avatar
Avatar
1
अग॰ 25
983
Support Process Blueprint functionality in Odoo (Same as Zoho desk Blueprint) | Odoo v17
helpdesk
Avatar
0
मार्च 25
2404
Update custom field after email is received in helpdesk
helpdesk
Avatar
0
अक्तू॰ 24
2399
Odoo is creating tickets for me with old emails Solved
helpdesk
Avatar
Avatar
1
सित॰ 24
2468
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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