Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

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

Subscribe

Get notified when there's activity on this post

This question has been flagged
1 Reply
21283 Views
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
Discard
Avatar
Ivan
Best Answer

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
Discard
samba
Author

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)
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
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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