Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

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

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

User Own Documents Only but for Contacts - Odoo 16

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
salescrmcontactsrecord_rules
2 Risposte
4496 Visualizzazioni
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
Abbandona
Avatar
Kristopher
Autore Risposta migliore

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
Abbandona
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
Risposta migliore

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
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
Unable to delete contacts of employees | Odoo Crm Sales
sales crm contacts customers
Avatar
Avatar
1
mag 24
3192
Connecting multiple contacts to one company Risolto
sales crm customer contacts
Avatar
Avatar
Avatar
2
ott 23
6703
Create res.partner record rules by user sales.team
contacts record_rules
Avatar
Avatar
Avatar
Avatar
3
ott 25
2667
Generate CRM opportunity from sales quotation
sales crm
Avatar
Avatar
Avatar
2
ago 25
4850
CRM, res_partner and fields Risolto
crm contacts
Avatar
Avatar
2
giu 25
2942
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة 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 è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

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