Ir al contenido
Odoo Menú
  • Iniciar sesión
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • PdV para tiendas
    • PdV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en vivo
    • eLearning
    Cadena de suministro
    • Inventario
    • Manufactura
    • PLM
    • Compras
    • Mantenimiento
    • Calidad
    Recursos humanos
    • Empleados
    • Reclutamiento
    • Vacaciones
    • Evaluaciones
    • Referencias
    • Flotilla
    Marketing
    • Redes sociales
    • Marketing por correo
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyectos
    • Registro de horas
    • Servicio externo
    • Soporte al cliente
    • Planeación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Artículos
    • WhatsApp
    Aplicaciones externas Studio de Odoo Plataforma de Odoo en la nube
  • Industrias
    Venta minorista
    • Librería
    • Tienda de ropa
    • Mueblería
    • Tienda de abarrotes
    • Ferretería
    • Juguetería
    Alimentos y hospitalidad
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidora de bebidas
    • Hotel
    Bienes inmuebles
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión de bienes inmuebles
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Firma contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Manufactura
    • Textil
    • Metal
    • Muebles
    • Comida
    • Cervecería
    • Regalos corporativos
    Salud y ejercicio
    • Club deportivo
    • Óptica
    • Gimnasio
    • Especialistas en bienestar
    • Farmacia
    • Peluquería
    Trades
    • Personal de mantenimiento
    • Hardware y soporte de TI
    • Sistemas de energía solar
    • Zapateros y fabricantes de calzado
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin fines de lucro
    • Agencia para la protección del medio ambiente
    • Alquiler de anuncios publicitarios
    • Fotografía
    • Alquiler de bicicletas
    • Distribuidor de software
    Descubre todas las industrias
  • Odoo Community
    Aprende
    • Tutoriales
    • Documentación
    • Certificaciones
    • Capacitación
    • Blog
    • Podcast
    Fortalece la educación
    • Programa educativo
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtén el software
    • Descargar
    • Compara ediciones
    • Versiones
    Colabora
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Conviértete en partner
    • Servicios para partners
    • Registra tu firma contable
    Obtén servicios
    • Encuentra un partner
    • Encuentra un contador
    • Contacta a un consultor
    • Servicios de implementación
    • Referencias de clientes
    • Soporte
    • Actualizaciones
    GitHub YouTube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicita una demostración
  • Precios
  • Ayuda

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

  • CRM
  • e-Commerce
  • Contabilidad
  • Inventario
  • PoS
  • Proyectos
  • MRP
All apps
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Debe estar registrado para interactuar con la comunidad.
Todas las publicaciones Personas Insignias
Etiquetas (Ver todo)
odoo accounting v14 pos v15
Acerca de este foro
Ayuda

Error when using UserError and ValidationError in odoo 14

Suscribirse

Reciba una notificación cuando haya actividad en esta publicación

Se marcó esta pregunta
servererror
1 Responder
5323 Vistas
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
Descartar
Avatar
Cybrosys Techno Solutions Pvt.Ltd
Mejor respuesta

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
Descartar
¿Le interesa esta conversación? ¡Participe en ella!

Cree una cuenta para poder utilizar funciones exclusivas e interactuar con la comunidad.

Registrarse
Publicaciones relacionadas Respuestas Vistas Actividad
custom code: Internal Server Error Cause Corrected But Error Still Persists
server error
Avatar
Avatar
1
oct 24
3052
Please, help me to solve the next error
server error
Avatar
0
dic 23
2376
"ValueError: Wrong value for slide.channel.user_ids" when click upon e-learning module
server error
Avatar
0
abr 21
3324
odoo13 : Error when open view fields from debug menu
server error
Avatar
Avatar
1
jun 20
4973
Odoo 10.0 Server on windows cannot start error 1053
server error
Avatar
2
abr 17
31
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento en Odoo.sh
  • Soporte
  • Actualizaciones del software
  • Desarrollos personalizados
  • Educación
  • Encuentra un contador
  • Encuentra un partner
  • Conviértete en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contáctanos
  • Empleos
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Legal • Privacidad
  • Seguridad
الْعَرَبيّة 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 es un conjunto de aplicaciones de código abierto que cubren todas las necesidades de tu empresa: CRM, comercio electrónico, contabilidad, inventario, punto de venta, gestión de proyectos, etc.

La propuesta única de valor de Odoo es ser muy fácil de usar y estar totalmente integrado.

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