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í
    Jídlo a pohostinství
    • Bar a Pub
    • Restaurace
    • Fast Food
    • Penzion
    • Distributor nápojů
    • Hotel
    Nemovitost
    • Realitní kancelář
    • Architektonická firma
    • Stavba
    • Správa nemovitostí
    • Zahradnictví
    • Asociace vlastníků nemovitosti
    Poradenství
    • Účetní firma
    • Odoo Partner
    • Marketingová agentura
    • Právník
    • Akvizice talentů
    • Audit a certifikace
    Výroba
    • Textile
    • Kov
    • Nábytek
    • Jídlo
    • Brewery
    • Korporátní dárky
    Zdraví a fitness
    • Sportovní klub
    • Prodejna brýli
    • Fitness Centrum
    • Wellness praktikové
    • Lékárna
    • Kadeřnictví
    Transakce
    • Údržbář
    • IT hardware a podpora
    • Systémy solární energie
    • Výrobce obuvi
    • Úklidové služby
    • Služby HVAC
    Ostatní
    • Nezisková organizace
    • 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

User Own Documents Only but for Contacts - Odoo 16

Odebírat

Get notified when there's activity on this post

This question has been flagged
salescrmcontactsrecord_rules
2 Odpovědi
4502 Zobrazení
Avatar
Kristopher

Hello,

I'm using Odoo community edition version 16. I would like to limit contact visibility like it is done for leads (In user settings I just select "User: Own Documents Only"). I would like to do the same but for Customers.

I search the web (and this forum) and fount a Record Rules mechanism. Unfortunately in my case it doesn't work well. I try to prepare a rules like "Personal Leads" and "All Leads", but for Contact model - but it doesn't work. I think there is a conflict with "res.partner.rule.private.employee". I tried to resolve it, but I broke the whole system, and need to restore database to fix it :/

How to limit the contact visibility for some users (maybe in Odoo 16 there is an easier way)?

0
Avatar
Zrušit
Avatar
Kristopher
Autor Nejlepší odpověď

Hi, Thank you for the answer, but it's a bit to detailed for me (I'm an Odoo beginner)

Where should I put all this xml statements? I an addons directory there is a "contacts" directory, but I can't find there similar lines. Should I create a new file or a new addon?

What is security group? Is it a group like "User: Own Documents Only" or "Internal User"?

What is the "module"? (As I understand the "model" is a database name, and a filed in developer mode Record Rule)


Ok, I think I got a solution. I have to deactivate private record rule for internal users and assign user as it's own salesperson in contacts. Now it seems to work...

1
Avatar
Zrušit
Franco Helguera

Whenever i try your solution, the user cant log in because this error : Due to security restrictions, you are not allowed to access 'User' (res.users) records.

Records: user1 (id=11)
User: user1 (id=11)

This restriction is due to the following rules:

Contact your administrator to request access if necessary.

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

Avatar
Cybrosys Techno Solutions Pvt.Ltd
Nejlepší odpověď

Hi,

By following these steps you can create a new rule for the partners.

1. Hope you have a module category for the module to add the security groups.

eg:

<record id="module_module_name" model="ir.module.category">
        <field name="name">Module Name</field>
        <field name="description">Access for Module Name</field>
        <field name="sequence">50</field>
 </record>

2. The next step is to create the security group. You can refer to the code below.

<record id="module_name_own_documents" model="res.groups">
        <field name="name">Own Timesheets Only</field>
        <field name="category_id" ref="your category id"/>
</record>

3. Next, add access rights for the newly created group in your security file.

eg: 

access_model_name_own_documents,access.model.name.own.documents,model_model_name,module_name_own_documents,1,1,1,0 

4. Add a field in your model for the user of the corresponding employee.

user_id = fields.Many2one('res.users', string='User',related='partner_id.user_id',help='The user of the partner')

5. And last, create the rule for viewing and creating own documents.

<record id="model_name_rule_user" model="ir.rule">
    <field name="name">Model Name: Own Records</field>
    <field name="model_id" ref="model_model_name"/>
    <field name="domain_force">[('user_id', '=', user.id)]</field>
    <field name="groups" eval="[(4, ref('module_name.user_group'))]"/>
</record>


Regards

0
Avatar
Zrušit
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
Unable to delete contacts of employees | Odoo Crm Sales
sales crm contacts customers
Avatar
Avatar
1
kvě 24
3196
Connecting multiple contacts to one company Vyřešeno
sales crm customer contacts
Avatar
Avatar
Avatar
2
říj 23
6707
Create res.partner record rules by user sales.team
contacts record_rules
Avatar
Avatar
Avatar
Avatar
3
říj 25
2672
Generate CRM opportunity from sales quotation
sales crm
Avatar
Avatar
Avatar
2
srp 25
4858
CRM, res_partner and fields Vyřešeno
crm contacts
Avatar
Avatar
2
čvn 25
2946
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