Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How do I do to a normal user just see own records and a special user see all ?

By
Anabela Damas
on 6/28/13, 9:57 AM 654 views

Hi,

I've tried to do something like in the sale module with "see own leads" and "see all leads" but I didn't find group_sale_salesman_all_leads in other file then sale_security.xml so I did like this:

mymodule/security/ir.model.access.csv

id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
acess_gestao_ideias1,gestao.ideias,model_gestao_ideias,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias2,gestao.ideias,model_gestao_ideias,group_gestao_ideias_user,1,1,1,0
acess_gestao_ideias3,gestao.ideias,model_gestao_ideias,group_gestao_ideias_watcher,1,0,0,0
access_ir_property_ideias,ir.property.ideias,base.model_ir_property,group_gestao_ideias_user,1,1,1,1
acess_gestao_ideias19,radar.vigilancia,model_radar_vigilancia,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias4,categ.criterios,model_categ_criterios,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias5,criterios.avaliacao,model_criterios_avaliacao,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias6,registos.vigilancia,model_registos_vigilancia,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias7,accoes.tarefas,model_accoes_tarefas,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias8,registos.vigilancia,model_registos_vigilancia,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias9,radar.eventos.tipo,model_radar_eventos_tipo,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias10,gestao.notificacoes,model_gestao_notificacoes,group_gestao_ideias_user,1,0,0,0
acess_gestao_ideias11,criterios.avaliacao,model_criterios_avaliacao,group_gestao_ideias_user,1,1,1,0

acess_gestao_ideias12,categ.criterios,model_categ_criterios,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias13,criterios.avaliacao,model_criterios_avaliacao,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias14,registos.vigilancia,model_registos_vigilancia,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias15,accoes.tarefas,model_accoes_tarefas,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias16,registos.vigilancia,model_registos_vigilancia,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias17,radar.eventos.tipo,model_radar_eventos_tipo,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias18,gestao.notificacoes,model_gestao_notificacoes,group_gestao_ideias_system_manager,1,1,1,1
acess_gestao_ideias20,radar.vigilancia,model_radar_vigilancia,group_gestao_ideias_user,1,1,1,1

mymodule/security/mymodule_security.xml

<?xml version="1.0" encoding="utf-8"?>
<openerp>
    <data noupdate="0">

        <record model="ir.module.category" id="module_category_group_gestao_ideias">
            <field name="name">Gestão Ideias</field>
            <field name="description">Something...</field>
            <field name="sequence">20</field>
        </record>

        <record model="res.groups" id="group_gestao_ideias_user">
            <field name="name">User</field>
            <field name="comment">Acesso aos Gestão de Ideias as proprias</field>
            <field name="category_id" ref="module_category_group_gestao_ideias"/>
        </record>

        <record model="res.groups" id="group_gestao_ideias_manager">
            <field name="name">Manager</field>
            <field name="comment">Acesso aos Gestão de Ideias</field>
            <field name="category_id" ref="module_category_group_gestao_ideias"/>
            <field name="implied_ids" eval="[(4, ref('gestao_ideias.group_gestao_ideias_user'))]"/>
        </record>

        <record model="res.groups" id="group_gestao_ideias_system_manager">
            <field name="name">System Manager</field>
            <field name="comment">Acesso aos Gestão de Ideias</field>
            <field name="category_id" ref="module_category_group_gestao_ideias"/>
            <field name="implied_ids" eval="[(4, ref('gestao_ideias.group_gestao_ideias_manager'))]"/>
            <field name="users" eval="[(4, ref('base.user_root'))]"/>
        </record>


        <record model="res.groups" id="group_gestao_ideias_watcher">
            <field name="name">Watcher</field>
            <field name="comment">Acesso aos Gestão de Ideias</field>
            <field name="category_id" ref="module_category_group_gestao_ideias"/>
        </record>
    </data>
</openerp>

Probably something is missing?

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 6/28/13, 9:57 AM
Seen: 654 times
Last updated: 3/16/15, 8:10 AM