Zum Inhalt springen
Odoo Menü
  • Anmelden
  • Jetzt gratis testen
  • Apps
    Finanzen
    • Buchhaltung
    • Rechnungsstellung
    • Spesenabrechnung
    • Tabellenkalkulation (BI)
    • Dokumente
    • E-Signatur
    Vertrieb
    • CRM
    • Vertrieb
    • Kassensystem – Shop
    • Kassensystem – Restaurant
    • Abonnements
    • Vermietung
    Websites
    • Website-Builder
    • E-Commerce
    • Blog
    • Forum
    • Livechat
    • E-Learning
    Lieferkette
    • Lager
    • Fertigung
    • PLM
    • Einkauf
    • Wartung
    • Qualität
    Personalwesen
    • Mitarbeiter
    • Personalbeschaffung
    • Abwesenheiten
    • Mitarbeiterbeurteilung
    • Personalempfehlungen
    • Fuhrpark
    Marketing
    • Social Marketing
    • E-Mail-Marketing
    • SMS-Marketing
    • Veranstaltungen
    • Marketing-Automatisierung
    • Umfragen
    Dienstleistungen
    • Projekte
    • Zeiterfassung
    • Außendienst
    • Kundendienst
    • Planung
    • Termine
    Produktivität
    • Dialog
    • Genehmigungen
    • IoT
    • VoIP
    • Wissensdatenbank
    • WhatsApp
    Apps von Drittanbietern Odoo Studio Odoo Cloud-Plattform
  • Branchen
    Einzelhandel
    • Buchladen
    • Kleidergeschäft
    • Möbelhaus
    • Lebensmittelgeschäft
    • Baumarkt
    • Spielwarengeschäft
    Essen & Gastgewerbe
    • Bar und Kneipe
    • Restaurant
    • Fast Food
    • Gästehaus
    • Getränkehändler
    • Hotel
    Immobilien
    • Immobilienagentur
    • Architekturbüro
    • Baugewerbe
    • Immobilienverwaltung
    • Gartenarbeit
    • Eigentümervereinigung
    Beratung
    • Buchhaltungsfirma
    • Odoo-Partner
    • Marketingagentur
    • Anwaltskanzlei
    • Talentakquise
    • Prüfung & Zertifizierung
    Fertigung
    • Textil
    • Metall
    • Möbel
    • Speisen
    • Brauerei
    • Firmengeschenke
    Gesundheit & Fitness
    • Sportklub
    • Brillengeschäft
    • Fitnessstudio
    • Therapeut
    • Apotheke
    • Friseursalon
    Handel
    • Handyman
    • IT-Hardware & -Support
    • Solarenergiesysteme
    • Schuster
    • Reinigungsdienstleistungen
    • HLK-Dienstleistungen
    Sonstiges
    • Gemeinnützige Organisation
    • Umweltschutzagentur
    • Plakatwandvermietung
    • Fotostudio
    • Fahrrad-Leasing
    • Software-Händler
    Alle Branchen ansehen
  • Community
    Lernen
    • Tutorials
    • Dokumentation
    • Zertifizierungen
    • Schulung
    • Blog
    • Podcast
    Bildung fördern
    • Bildungsprogramm
    • Scale-Up! Planspiel
    • Odoo besuchen
    Software anfragen
    • Herunterladen
    • Editionen vergleichen
    • Releases
    Zusammenarbeiten
    • Github
    • Forum
    • Veranstaltungen
    • Übersetzungen
    • Partner werden
    • Dienstleistungen für Partner
    • Buchhaltungsfirma registrieren
    Services anfragen
    • Partner finden
    • Buchhalter finden
    • Einen Experten treffen
    • Implementierungsservices
    • Kundenreferenzen
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Eine Demo erhalten
  • Preiskalkulation
  • Hilfe

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

  • CRM
  • e-Commerce
  • Buchhaltung
  • Lager
  • PoS
  • Projekte
  • MRP
All apps
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Sie müssen registriert sein, um mit der Community zu interagieren.
Alle Beiträge Personen Abzeichen
Stichwörter (Alle anzeigen)
odoo accounting v14 pos v15
Über dieses Forum
Hilfe

Error when using UserError and ValidationError in odoo 14

Abonnieren

Erhalten Sie eine Benachrichtigung, wenn es eine Aktivität zu diesem Beitrag gibt

Diese Frage wurde gekennzeichnet
servererror
1 Antworten
5317 Ansichten
Avatar
Nguyễn Đinh Hoàng Mỹ

When I use the ValidationError and UserError of odoo version 14 running on an ubuntu server to show the error to the user with an example statement like: 

 raise UserError(_('No API configuration parameter found. Please contact IT !')) 

but I get the error:

2023-05-14 05:55:10,281 20270 INFO his_odoo_v2 longpolling: 192.168.11.112 - - [2023-05-14 05:55:10] "POST /longpolling/im_status HTTP/1.0" 200 1961 0.015715 
2023-05-14 05:55:22,433 20270 INFO his_odoo_v2 longpolling: 192.168.11.112 - - [2023-05-14 05:55:22] "POST /longpolling/poll HTTP/1.0" 200 408 50.015951 
2023-05-14 05:55:33,193 20268 INFO his_odoo_v2 werkzeug: 172.10.1.103 - - [14/May/2023 05:55:33] "POST /longpolling/im_status HTTP/1.1" 200 - 5 0.009 0.011
2023-05-14 05:55:35,287 20270 INFO his_odoo_v2 longpolling: 192.168.11.112 - - [2023-05-14 05:55:35] "POST /longpolling/im_status HTTP/1.0" 200 1961 0.019660 
2023-05-14 05:55:37,276 20270 INFO his_odoo_v2 longpolling: 192.168.11.112 - - [2023-05-14 05:55:37] "POST /longpolling/im_status HTTP/1.0" 200 1961 0.015995 
2023-05-14 05:55:38,175 20267 INFO his_odoo_v2 werkzeug: 172.10.1.103 - - [14/May/2023 05:55:38] "POST /longpolling/poll HTTP/1.1" 500 - 1 0.000 0.003
2023-05-14 05:55:38,176 20267 ERROR his_odoo_v2 werkzeug: Error on request:
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/werkzeug/serving.py", line 306, in run_wsgi
execute(self.server.app)
File "/usr/local/lib/python3.8/dist-packages/werkzeug/serving.py", line 294, in execute
application_iter = app(environ, start_response)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 113, in application
return application_unproxied(environ, start_response)
File "/odoo/odoo-server/odoo/service/wsgi_server.py", line 88, in application_unproxied
result = odoo.http.root(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1307, in __call__
return self.dispatch(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1273, in __call__
return self.app(environ, start_wrapped)
File "/usr/local/lib/python3.8/dist-packages/werkzeug/middleware/shared_data.py", line 220, in __call__
return self.app(environ, start_response)
File "/odoo/odoo-server/odoo/http.py", line 1502, in dispatch
return response(environ, start_response)
TypeError: 'NoneType' object is not callable - - -

I have tried, but still couldn't find the cause. I hope everyone can help me, thank you all very much. 

0
Avatar
Verwerfen
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Beste Antwort

Hi,


It looks like you’re using UserError or ValidationError correctly in your code. The issue you're encountering—TypeError: 'NoneType' object is not callable—doesn't directly relate to how you're raising the exception, but might point to a deeper problem in your environment or code flow.


Here are a few things you can try:


Double-check your import

Make sure you're importing the exceptions properly at the top of your Python file:

python

from odoo.exceptions import UserError, ValidationError


Use the exception like this:


python

raise UserError(_('No API configuration parameter found. Please contact IT!'))


Check the full traceback

Sometimes, the actual cause of the NoneType error might be elsewhere in the function or in how the return is handled after raising the error. Ensure your method doesn't return None where a callable is expected.


You can also check out these helpful resources:


https://www.youtube.com/watch?v=eaP7J1oYmOo


https://www.cybrosys.com/blog/how-to-run-efficient-error-management-with-the-odoo-14-exceptions


Hope it helps

0
Avatar
Verwerfen
Diskutieren Sie gerne? Treten Sie bei, statt nur zu lesen!

Erstellen Sie heute ein Konto, um exklusive Funktionen zu nutzen und mit unserer tollen Community zu interagieren!

Registrieren
Verknüpfte Beiträge Antworten Ansichten Aktivität
custom code: Internal Server Error Cause Corrected But Error Still Persists
server error
Avatar
Avatar
1
Okt. 24
3046
Please, help me to solve the next error
server error
Avatar
0
Dez. 23
2375
"ValueError: Wrong value for slide.channel.user_ids" when click upon e-learning module
server error
Avatar
0
Apr. 21
3315
odoo13 : Error when open view fields from debug menu
server error
Avatar
Avatar
1
Juni 20
4973
Odoo 10.0 Server on windows cannot start error 1053
server error
Avatar
2
Apr. 17
31
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Herunterladen
  • Github
  • Runbot
  • Übersetzungen
Dienstleistungen
  • Odoo.sh-Hosting
  • Support
  • Upgrade
  • Individuelle Entwicklungen
  • Ausbildung
  • Buchhalter finden
  • Partner finden
  • Partner werden
Über uns
  • Unsere Firma
  • Markenwerte
  • Kontakt
  • Karriere
  • Veranstaltungen
  • Podcast
  • Blog
  • Kunden
  • Rechtliches • Datenschutz
  • Sicherheit
الْعَرَبيّة 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 ist eine Suite von Open-Source-Betriebsanwendungen, die alle Bedürfnisse Ihres Unternehmens abdecken: CRM, E-Commerce, Buchhaltung, Lager, Kassensystem, Projektmanagement etc.

Das einzigartige Wertversprechen von Odoo ist, dass es gleichzeitig sehr einfach zu bedienen und voll integriert ist.

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