Ir al contenido
Odoo Menú
  • Identificarse
  • Pruébalo gratis
  • Aplicaciones
    Finanzas
    • Contabilidad
    • Facturación
    • Gastos
    • Hoja de cálculo (BI)
    • Documentos
    • Firma electrónica
    Ventas
    • CRM
    • Ventas
    • TPV para tiendas
    • TPV para restaurantes
    • Suscripciones
    • Alquiler
    Sitios web
    • Creador de sitios web
    • Comercio electrónico
    • Blog
    • Foro
    • Chat en directo
    • e-learning
    Cadena de suministro
    • Inventario
    • Fabricación
    • PLM
    • Compra
    • Mantenimiento
    • Calidad
    Recursos Humanos
    • Empleados
    • Reclutamiento
    • Ausencias
    • Evaluación
    • Referencias
    • Flota
    Marketing
    • Marketing social
    • Marketing por correo electrónico
    • Marketing por SMS
    • Eventos
    • Automatización de marketing
    • Encuestas
    Servicios
    • Proyecto
    • Partes de horas
    • Servicio de campo
    • Servicio de asistencia
    • Planificación
    • Citas
    Productividad
    • Conversaciones
    • Aprobaciones
    • IoT
    • VoIP
    • Conocimientos
    • WhatsApp
    Aplicaciones de terceros Studio de Odoo Plataforma de Odoo Cloud
  • Industrias
    Comercio al por menor
    • Librería
    • Tienda de ropa
    • Tienda de muebles
    • Tienda de ultramarinos
    • Ferretería
    • Juguetería
    Alimentación y hostelería
    • Bar y pub
    • Restaurante
    • Comida rápida
    • Casa de huéspedes
    • Distribuidor de bebidas
    • Hotel
    Inmueble
    • Agencia inmobiliaria
    • Estudio de arquitectura
    • Construcción
    • Gestión inmobiliaria
    • Jardinería
    • Asociación de propietarios
    Consultoría
    • Empresa contable
    • Partner de Odoo
    • Agencia de marketing
    • Bufete de abogados
    • Adquisición de talentos
    • Auditorías y certificaciones
    Fabricación
    • Textil
    • Metal
    • Muebles
    • Alimentos
    • Cervecería
    • Regalos de empresas
    Salud y bienestar
    • Club deportivo
    • Óptica
    • Gimnasio
    • Terapeutas
    • Farmacia
    • Peluquería
    Oficios
    • Handyman
    • Hardware y soporte técnico
    • Sistemas de energía solar
    • Zapatero
    • Servicios de limpieza
    • Servicios de calefacción, ventilación y aire acondicionado
    Otros
    • Organización sin ánimo de lucro
    • Agencia de protección del medio ambiente
    • Alquiler de paneles publicitarios
    • Estudio fotográfico
    • Alquiler de bicicletas
    • Distribuidor de software
    Explorar todos los sectores
  • Comunidad
    Aprender
    • Tutoriales
    • Documentación
    • Certificaciones
    • Formación
    • Blog
    • Podcast
    Potenciar la educación
    • Programa de formación
    • Scale Up! El juego empresarial
    • Visita Odoo
    Obtener el software
    • Descargar
    • Comparar ediciones
    • Versiones
    Colaborar
    • GitHub
    • Foro
    • Eventos
    • Traducciones
    • Convertirse en partner
    • Servicios para partners
    • Registrar tu empresa contable
    Obtener servicios
    • Encontrar un partner
    • Encontrar un asesor fiscal
    • Contacta con un experto
    • Servicios de implementación
    • Referencias de clientes
    • Ayuda
    • Actualizaciones
    GitHub YouTube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Solicitar 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
  • Proyecto
  • 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

why i am getting this " Document type: res.users, Operation: read" error, eventhough i have given access permissions to the user?

Suscribirse

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

Se marcó esta pregunta
1 Responder
21296 Vistas
Avatar
samba

I have developed small module to make relation with product manager and partner in odoo-8 (this is my need). I have inherited "res.partner" and added "'user_ids':fields.one2many('res.users','res_partner_id','Users', readonly=True)," filed. I have inhrited "res.users" and added "'res_partner_id':fields.many2one('res.partner','Partner'),". It's working fine.

 

I duplicated sales manager group and removed all inherited groups. I have added some Rules to this new group.

object :sale.order.line   rule:[('product_id.product_tmpl_id.product_manager.res_partner_id.id','=',user.res_partner_id.id)]
object :sale.order  rule:[('order_line.product_id.product_tmpl_id.product_manager.res_partner_id.id','=',user.res_partner_id.id)]
object :product.product   rule:[('product_tmpl_id.product_manager.res_partner_id.id','=',user.res_partner_id.id)]
object :product.template  rule:[('product_manager.res_partner_id.id','=',user.res_partner_id.id)]
object :res.users         rule:[('res_partner_id.id','=',user.res_partner_id.id)].

I have given this group to a user. When i login with this user credentials and try to create invoice for sales order, then it is showing doument error for (product.product, read) and (res.users, read ). I can deliver the product with this user credentials, but unable to creating a invoice for sales order. I have added all access rights(read, write, create, delete) for product.produc and res.users model to this group. Can any one help me please.  

1
Avatar
Descartar
Avatar
Ivan
Mejor respuesta

Your rules states that a user can only read any user whose res_partner_id is the same as the login user's res_partner_id (assuming that you set the rules for Read as well).  So, there may be cases where a record (e.g. product) is created or updated by user that does not falls into that criteria.  AFAIK, putting domain on res.users via Record Rules is not a good idea.  It is better to use domain in views so that the filtering is localized.

2
Avatar
Descartar
samba
Autor

Thank you Ivan. That product created by the user itself who log in to system. I have removed record rule on the res.users model. Now user can able to create invoice. But it is showing (document type: "product.product", read) wiazrd when the user click on "create invoice" button of the sales order . It's not stop the user from creating the invoice, user can able to create the invoice. Can you please tell me why this error showing?.

Ivan

@samba, it is most probably still caused by access configuration. First, make sure that the user have access control list to read that product.product or any models that is related to product.product. Next, make sure that there is no Record Rules that prevented the user from reading the given product.product or underlying models. Easy way to check is to go to a menu that shows Products, and see if this user can display the products used in sale.order in Form View. If the user can view the products, then maybe the error is somewhere else. If the user cannot view the product, then it is most probably access configuration (either access control or record rules). Either way, it is better if you can provide the log that correspond to that error.

OdooBot
Thank you Ivan,
Here is the log.
AccessError: ('AccessError', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: product.product, Operation: read)')
2015-01-07 11:54:38,297 1524 WARNING vendor-login openerp.models: Access Denied by record rules for operation: read on record ids: [55], uid: 9, model: product.product
2015-01-07 11:54:38,298 1524 ERROR vendor-login openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/http.py", line 518, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/openerp/http.py", line 539, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/openerp/http.py", line 295, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/http.py", line 292, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 755, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 388, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 949, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/product/product.py", line 1032, in name_get
    self.check_access_rule(cr, user, ids, "read", context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3460, in check_access_rule
    self._check_record_rules_result_count(cr, uid, sub_ids, returned_ids, operation, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3409, in _check_record_rules_result_count
    (self._description, operation))
except_orm: (u'Access Denied', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: Product, Operation: read)')

On Wed, Jan 7, 2015 at 5:07 PM, Ivan <niecw@mail.odoo.com> wrote:

@samba, it is most probably still caused by access configuration. First, make sure that the user have access control list to read that product.product or any models that is related to product.product. Next, make sure that there is no Record Rules that prevented the user from reading the given product.product or underlying models. Easy way to check is to go to a menu that shows Products, and see if this user can display the products used in sale.order in Form View. If the user can view the products, then maybe the error is somewhere else. If the user cannot view the product, then it is most probably access configuration (either access control or record rules). Either way, it is better if you can provide the log that correspond to that error.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)
OdooBot
The user can able to view and edit the product of sales order.

On Wed, Jan 7, 2015 at 5:25 PM, Samba Odoo <sambaodoo@gmail.com> wrote:
Thank you Ivan,
Here is the log.
AccessError: ('AccessError', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: product.product, Operation: read)')
2015-01-07 11:54:38,297 1524 WARNING vendor-login openerp.models: Access Denied by record rules for operation: read on record ids: [55], uid: 9, model: product.product
2015-01-07 11:54:38,298 1524 ERROR vendor-login openerp.http: Exception during JSON request handling.
Traceback (most recent call last):
  File "/opt/odoo/odoo-server/openerp/http.py", line 518, in _handle_exception
    return super(JsonRequest, self)._handle_exception(exception)
  File "/opt/odoo/odoo-server/openerp/http.py", line 539, in dispatch
    result = self._call_function(**self.params)
  File "/opt/odoo/odoo-server/openerp/http.py", line 295, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper
    return f(dbname, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/http.py", line 292, in checked_call
    return self.endpoint(*a, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 755, in __call__
    return self.method(*args, **kw)
  File "/opt/odoo/odoo-server/openerp/http.py", line 388, in response_wrap
    response = f(*args, **kw)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 949, in call_kw
    return self._call_kw(model, method, args, kwargs)
  File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 941, in _call_kw
    return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/addons/product/product.py", line 1032, in name_get
    self.check_access_rule(cr, user, ids, "read", context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3460, in check_access_rule
    self._check_record_rules_result_count(cr, uid, sub_ids, returned_ids, operation, context=context)
  File "/opt/odoo/odoo-server/openerp/api.py", line 237, in wrapper
    return old_api(self, *args, **kwargs)
  File "/opt/odoo/odoo-server/openerp/models.py", line 3409, in _check_record_rules_result_count
    (self._description, operation))
except_orm: (u'Access Denied', u'The requested operation cannot be completed due to security restrictions. Please contact your system administrator.\n\n(Document type: Product, Operation: read)')

On Wed, Jan 7, 2015 at 5:07 PM, Ivan <niecw@mail.odoo.com> wrote:

@samba, it is most probably still caused by access configuration. First, make sure that the user have access control list to read that product.product or any models that is related to product.product. Next, make sure that there is no Record Rules that prevented the user from reading the given product.product or underlying models. Easy way to check is to go to a menu that shows Products, and see if this user can display the products used in sale.order in Form View. If the user can view the products, then maybe the error is somewhere else. If the user cannot view the product, then it is most probably access configuration (either access control or record rules). Either way, it is better if you can provide the log that correspond to that error.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)
Ivan

Can you elaborate what do you mean by "The user can able to view and edit the product of sales order."? How are they viewing and editing the product? From which menu?

OdooBot
From sales -> products -> products screen.

On Thu, Jan 8, 2015 at 5:42 PM, Ivan <niecw@mail.odoo.com> wrote:

Can you elaborate what do you mean by "The user can able to view and edit the product of sales order."? How are they viewing and editing the product? From which menu?

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post False



--
--

Thanks and Regards,

Sambasiva rao,

Skype: samba.guduru2(skype)
¿Le interesa esta conversación? ¡Participe en ella!

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

Inscribirse
Comunidad
  • Tutoriales
  • Documentación
  • Foro
Código abierto
  • Descargar
  • GitHub
  • Runbot
  • Traducciones
Servicios
  • Alojamiento Odoo.sh
  • Ayuda
  • Actualizar
  • Desarrollos personalizados
  • Educación
  • Encontrar un asesor fiscal
  • Encontrar un partner
  • Convertirse en partner
Sobre nosotros
  • Nuestra empresa
  • Activos de marca
  • Contacta con nosotros
  • Puestos de trabajo
  • Eventos
  • Podcast
  • Blog
  • Clientes
  • Información 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 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