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

How to debug access permissions

Suscribirse

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

Se marcó esta pregunta
4 Respuestas
7552 Vistas
Avatar
Hunter Pavers

Created a sale order

A user with Inventory Manager and Sale Manager access levels tries to confirm sale order quotation.

An error message appears:

The requested operation cannot be completed due to security restrictions. Please contact your system administrator.

(Document type: stock.location, Operation: read)


Why? Where? How?
Which model? Which group?
How can I find which access permission is missing? How can I debug it?
Thanks in advance.

0
Avatar
Descartar
Avatar
Hunter Pavers
Autor Mejor respuesta

So here is how I debugged the problem, what was the problem and the way I solved it.
When Odoo nags about access permission it is very cold! There is just a dialog saying that you cannot access a model and that you have to contact the Administrator and if you're the administrator, you gonna' have hard times once your colleagues come to you just to find you clueless about source of the problem.
This is how I debugged it:
I modified the file ./models.py in root folder of Odoo to add traceback and variable dump functionality to it. As I was using official docker image of Odoo I had to modify my docker file to make odoo installation folder writable:

RUN chmod a+rwx -R /usr/lib/python2.7/dist-packages/odoo \

    && apt-get update && apt-get -y install vim

And to add the vim. Later I modified:
     /usr/lib/python2.7/dist-packages/odoo/models.py
And here is the diff:
29d28

< import traceback

3172,3175d3170

< _logger.info('HERE!')

< _logger.info(vars(self))

< for line in traceback.format_stack():

< _logger.info(line.strip())
Looking into traceback and vars output told me that the issue is happening due to trying to access a location with some ID.
What was the probem?
Looking into database I found the root cause. Some incompetent personnel of us couldn't do something easy in Odoo so desparately went to warehouse configuration and tried to change anything he could find by random, including changing parent location of locations, etc. so messed with our whole inventory system. In our case an old and archived location was set as parent location of 'Physical Location' therefore rendering all physical locations useless!
How I solved the issue?
Pretty much reverted his changes through database tables.


Conclusion

The access permission error message is pretty useless and just sends employees to administrators. The log output of server doesn't help either. Adding a traceback and vars output to log output helps a lot. I grep'ed the whole source tree for the error message to find that the error is happening in two places within models.py and added traceback and vars output to one of them so I was able to solve the issue.
Thanks.

1
Avatar
Descartar
Avatar
Niyas Raphy (Walnut Software Solutions)
Mejor respuesta

Hi Aario,

First of all you have to check which user group is currently logged in, ie whether user in sales or manager in sales like that.

Then here in the warning message it is shown that there is no access permission for the model 'stock.location' . So what you have to do is,

Activate the developer mode, then go to Settings -> Users -> Groups , then select the corresponding group and add the model in the access right tab(if it is not there ), with required permission such as read, write, delete and create.


Thanks

1
Avatar
Descartar
Hunter Pavers
Autor

Thanks for the reply. I checked the user is member of both Sales Manager and Inventory / Manager and for both groups read permission was already granted for stock.location model. I granted all permissions for this model yet it's not possible to confirm a sale order and same error happens. Any idea is highly appreciated.

Hunter Pavers
Autor

Actually no user other than administrator itself can confirm a sale. Even users with all the permissions granted even administration settings.

Niyas Raphy (Walnut Software Solutions)

on clicking the confirm button you getting the above warning message ?

¿Le interesa esta conversación? ¡Participe en ella!

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

Registrarse
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.

Sitio web hecho con

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