Přejít na obsah
Odoo Menu
  • Přihlásit se
  • Vyzkoušejte zdarma
  • Aplikace
    Finance
    • Účetnictví
    • Fakturace
    • Výdaje
    • Spreadsheet (BI)
    • Dokumenty
    • Podpisy
    Prodej
    • CRM
    • Prodej
    • POS Obchod
    • POS Restaurace
    • Předplatné
    • Pronájem
    Webové stránky
    • Webové stránky
    • E-shop
    • Blog
    • Fórum
    • Živý chat
    • eLearning
    Dodavatelský řetězec
    • Sklad
    • Výroba
    • PLM
    • Nákup
    • Údržba
    • Kvalita
    Lidské zdroje
    • Zaměstnanci
    • Nábor
    • Volno
    • Hodnocení zaměstnanců
    • Doporučení
    • Vozový park
    Marketing
    • Marketing sociálních sítí
    • Emailový marketing
    • SMS Marketing
    • Události
    • Marketingová automatizace
    • Dotazníky
    Služby
    • Projekt
    • Časové výkazy
    • Práce v terénu
    • Helpdesk
    • Plánování
    • Schůzky
    Produktivita
    • Diskuze
    • Schvalování
    • IoT
    • VoIP
    • Znalosti
    • WhatsApp
    Aplikace třetích stran Odoo Studio Odoo cloudová platforma
  • Branže
    Maloobchod
    • Knihkupectví
    • Obchod s oblečením
    • Obchod s nábytkem
    • Potraviny
    • Obchod s hardwarem
    • Hračkářství
    Food & Hospitality
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Guest House
    • Distributor nápojů
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Trades
    • Údržbář
    • IT hardware a podpora
    • Solar Energy Systems
    • Výrobce obuvi
    • Úklidové služby
    • HVAC Services
    Others
    • Nonprofit Organization
    • Agentura pro životní prostředí
    • Pronájem billboardů
    • Fotografování
    • Leasing jízdních kol
    • Prodejce softwaru
    Browse all Industries
  • Komunita
    Edukační program
    • Tutoriály
    • Dokumentace
    • Certifikace
    • Vzdělávání
    • Blog
    • Podcast
    Podpora vzdělávání
    • Vzdělávací program
    • Scale Up! Hra na firmu
    • Navštivte Odoo
    Získat software
    • Stáhnout
    • Porovnejte edice
    • Verze
    Spolupráce
    • Github
    • Fórum
    • Události
    • Překlady
    • Stát se partnerem
    • Services for Partners
    • Registrujte svou účetní firmu
    Získat služby
    • Najít partnera
    • Najít účetní
    • Setkejte se s poradcem
    • Implementační služby
    • Zákaznické reference
    • Podpora
    • Upgrady
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dohodnout demo
  • Ceník
  • Pomoc

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

  • CRM
  • e-Commerce
  • Účetnictví
  • Sklad
  • PoS
  • Projekty
  • MRP
All apps
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
You need to be registered to interact with the community.
All Posts Lidé Odznaky
Štítky (View all)
odoo accounting v14 pos v15
O tomto fóru
Pomoc

Restrict users to see only his own contacts

Odebírat

Get notified when there's activity on this post

This question has been flagged
contactsrecord_rulesodoo12
4 Odpovědi
25040 Zobrazení
Avatar
Alexander

Hello I'm trying to restrict the users to see only his own contacts, I made the following changes:

1. Create a new group Show Own Contacts Only for Extra Rights application.

2. Create a new record rule Own contacts for the Contact object that applies for read, write, create and delete
and uses [('user_id', '=', user.id)] as Domain Filter and add Show Own Contacts Only as Group.

So far so good, but when I login I can still see all the contacts and I can only modify (write) the contacts that belong to the user that is logged in. I get a (Document type: Contact, Operation: write) error.

After making some tests I discovered that if I archive the ​res.partner.rule.private.employee​ rule my new record rule works as I expect. I can see only the user contacts. Also if a make my Own contacts my rule global it works too.

Why if I can't write on a contact that does not belong to me I still see it? What's the utility of this res.partner.rule.private.employee​ rule?

There's something missing here but I don't know what. Any suggestion?

0
Avatar
Zrušit
Niyas Raphy (Walnut Software Solutions)

There is a group named Contact Creation make sure that the user is not belonging to that group

Sehrish

Groups and Access Rights in Odoo: https://goo.gl/4jAhtH

Avatar
Alexander
Autor Nejlepší odpověď

Hello, I don't if is the right approach but I solved the problem as follows:

1) Switch off the record rule res.partner.rule.private.employee.

2) Create a new record rule Own contacts for the Contact object that applies for read, write, create and delete
and uses ['|', ('type', '!=', 'private'), ('type', '=', False), ('user_id', '=', user.id)] as Domain Filter and Sale /User: Own Documents Only as Group.

3) Create a new record rule All contacts for the Contact object that applies for read, write, create and delete
and uses [(1, '!=', 1)] as Domain Filter and Sale /User: All Documents as Group.

In this way, I can restrict the users to see their own contacts and also keep the private address feature.

Suggestions are welcome. Regards.


1
Avatar
Zrušit
Chris TRINGHAM

Some thoughts (since you asked):

The Domain Filter [(1, '!=', 1)] will always test false and I think you mean [(1,'=',1)]. But that will allow this user group to access private addresses. Is that what you want?

Also, any other users (e.g. purchase, inventory, accounting) will have access to private addresses. Is that what you want?

Alexander
Autor

Hello Chris,

You're right the domain filter should be [(1,'=',1)], on the other hand, why do you say that any other users will have access to private addresses? Now, the domain of the archived rule (res.partner.rule.private.employee) apply on the Sale /User: Own Documents Only group and not on the Intern User group, which is the group from where inherit the lowest level of access (User) for inventory, purchase, etc.

If I'm wrong I will appreciate your comment.

Greetings

Chris TRINGHAM

Without record rules, users have access to all records (if they have access to the table / model).

When you add a record rule it can restrict access.

In your setup, most users ((e.g. purchase, inventory, accounting) will not have any record rule to limit their access to contacts, so they will have access to all records, including private addresses.

Ali

i do ur answer step by step but dosen't work.

1st : deactive "res.partner.rule.private.employee"

2 : in record rule Create Own contacts By ['|', ('type', '!=', 'private'), ('type', '=', False), ('user_id', '=', user.id)] domain and sale/user : own... group

3 : in record rule Create All contact By [(1,'=',1)] and sale/user :All doc.. group

if u can help me to solve my problem

i need to sale's user couldn't access or see any contact from purchase's user and as purchase's user from sale's user

simo br

Your solution seems to work fine, the issue that i got is when trying to create a new sale order i get this message :

The requested operation ("read" on "Users" (res.users)) was rejected because of the following rules:

(Records: False (id=8), User: False (id=8))

Implicitly accessed through 'Users' (res.users).

How can i fix it ?

Avatar
Marcelo Costa
Nejlepší odpověď

Hello,

I am using odoo12 community version. 

I following the best anwser this topic (Alexander) and my SaleUser see only your contacts, but cannot create a quotation or a sale order.

The error message dialog: (Document type: Users, Operation: read) - (Records: [9], User: 9).

Does anyone face same issue and knows how to fix it?

Thanks,

Marcelo Costa
Porto Alegre, Brazil

0
Avatar
Zrušit
simo br

have you found any solutions ? i also have the same issue

Avatar
Chris TRINGHAM
Nejlepší odpověď

The res.partner.rule.private.employee rule is used for the "private address" functionality - Private Addresses are only accessible for users in the "Access to Private Address" group and blocked for other users.

If you remove the two record rules related to private addresses (res.partner.rule.private.group and res.partner.rule.private.employee) then you will lose that functionality but your Record Rule should work.

Making your Record Rule global should also work because global record rules can't be bypassed, whereas all non-global rules applying to a user will take effect (an 'OR' relationship).

https://odootricks.tips/record-rules

0
Avatar
Zrušit
ayman awad ali

Hello, the rule is working, but the user can't make new contact.
access error is (This restriction is due to the following rules: Own contacts)
How can i fix it ?

Ameen Alkurdy

@ayman I'm having the same problem did you fix it ?

Franco Helguera

Same problem, any fix ?

Chris TRINGHAM

If these are questions about the suggested Record Rule on users only being able to see their own contacts, this could be set not to apply on creation.

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

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

Přihlásit se
Related Posts Odpovědi Zobrazení Aktivita
Create res.partner record rules by user sales.team
contacts record_rules
Avatar
Avatar
Avatar
Avatar
3
říj 25
2600
Odoo 16: Hide Suppliers in Contact Module Vyřešeno
contacts record_rules
Avatar
1
lis 23
2487
Sales Channel Team Leader: See own team's record
record_rules odoo12
Avatar
0
čvc 23
207
Odoo, how to make that an user can only see his partners (through parent_id field)
record_rules odoo12
Avatar
Avatar
1
dub 22
3937
Restrict access to contact based on allowed companies
record_rules odoo12
Avatar
Avatar
1
čvn 25
5321
Komunita
  • Tutoriály
  • Dokumentace
  • Fórum
Open Source
  • Stáhnout
  • Github
  • Runbot
  • Překlady
Služby
  • Odoo.sh hostování
  • Podpora
  • Upgrade
  • Nestandardní vývoj
  • Edukační program
  • Najít účetní
  • Najít partnera
  • Stát se partnerem
O nás
  • Naše společnost
  • Podklady značky
  • Kontakujte nás
  • Práce
  • Události
  • Podcast
  • Blog
  • Zákazníci
  • Právní dokumenty • Soukromí
  • Zabezpečení
الْعَرَبيّة 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 je balíček open-source aplikací, které pokrývají všechny potřeby vaší společnosti: CRM, e-shop, účetnictví, sklady, kasy, projektové řízení a další.

Unikátní nabídka od Odoo poskytuje velmi jednoduché uživatelské rozhraní a vše je integrované na jednom místě.

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