Skip to Content
Odoo Menu
  • Prijavi
  • Try it free
  • Aplikacije
    Finance
    • Knjigovodstvo
    • Obračun
    • Stroški
    • Spreadsheet (BI)
    • Dokumenti
    • Podpisovanje
    Prodaja
    • CRM
    • Prodaja
    • POS Shop
    • POS Restaurant
    • Naročnine
    • Najem
    Spletne strani
    • Website Builder
    • Spletna trgovina
    • Blog
    • Forum
    • Pogovor v živo
    • eUčenje
    Dobavna veriga
    • Zaloga
    • Proizvodnja
    • PLM
    • Nabava
    • Vzdrževanje
    • Kakovost
    Kadri
    • Kadri
    • Kadrovanje
    • Odsotnost
    • Ocenjevanja
    • Priporočila
    • Vozni park
    Marketing
    • Družbeno Trženje
    • Email Marketing
    • SMS Marketing
    • Dogodki
    • Avtomatizacija trženja
    • Ankete
    Storitve
    • Projekt
    • Časovnice
    • Storitve na terenu
    • Služba za pomoč
    • Načrtovanje
    • Termini
    Produktivnost
    • Razprave
    • Odobritve
    • IoT
    • Voip
    • Znanje
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industrije
    Trgovina na drobno
    • Book Store
    • Trgovina z oblačili
    • Trgovina s pohištvom
    • Grocery Store
    • Trgovina s strojno opremo računalnikov
    • Trgovina z igračami
    Food & Hospitality
    • Bar and Pub
    • Restavracija
    • Hitra hrana
    • Guest House
    • Beverage Distributor
    • Hotel
    Nepremičnine
    • Real Estate Agency
    • Arhitekturno podjetje
    • Gradbeništvo
    • Estate Management
    • Vrtnarjenje
    • Združenje lastnikov nepremičnin
    Svetovanje
    • Računovodsko podjetje
    • Odoo Partner
    • Marketinška agencija
    • Law firm
    • Pridobivanje talentov
    • Audit & Certification
    Proizvodnja
    • Tekstil
    • Metal
    • Pohištvo
    • Hrana
    • Brewery
    • Poslovna darila
    Health & Fitness
    • Športni klub
    • Trgovina z očali
    • Fitnes center
    • Wellness Practitioners
    • Lekarna
    • Frizerski salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Sistemi sončne energije
    • Izdelovalec čevljev
    • Čistilne storitve
    • HVAC Services
    Ostali
    • Neprofitna organizacija
    • Agencija za okolje
    • Najem oglasnih panojev
    • Fotografija
    • Najem koles
    • Prodajalec programske opreme
    Browse all Industries
  • Skupnost
    Learn
    • Tutorials
    • Dokumentacija
    • Certifikati
    • Šolanje
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Prenesi
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Dogodki
    • Prevodi
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Sklici kupca
    • Podpora
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Določanje cen
  • Pomoč

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

  • CRM
  • e-Commerce
  • Knjigovodstvo
  • Zaloga
  • PoS
  • Projekt
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Ključne besede (View all)
odoo accounting v14 pos v15
About this forum
Pomoč

How to debug access permissions

Naroči se

Get notified when there's activity on this post

This question has been flagged
4 Odgovori
7547 Prikazi
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
Opusti
Avatar
Hunter Pavers
Avtor Best Answer

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
Opusti
Avatar
Niyas Raphy (Walnut Software Solutions)
Best Answer

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
Opusti
Hunter Pavers
Avtor

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
Avtor

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 ?

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Prijavi
Community
  • Tutorials
  • Dokumentacija
  • Forum
Open Source
  • Prenesi
  • Github
  • Runbot
  • Prevodi
Services
  • Odoo.sh Hosting
  • Podpora
  • Nadgradnja
  • Custom Developments
  • Izobraževanje
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Sredstva blagovne znamke
  • Kontakt
  • Zaposlitve
  • Dogodki
  • Podcast
  • Blog
  • Stranke
  • Pravno • Zasebnost
  • Varnost
الْعَرَبيّة 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