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

Is possible remove the button "create" for a specify group and for specify state?

By
Luís
on 7/26/13, 8:00 AM 1,239 views

Hi,

I tried remove the button "create" for a specify group and for specify state.

For all users and for all states I tried with something like this and works:

<record id="view_picking_out_tree_change" model="ir.ui.view">
            <field name="name">stock.picking.out.tree.change</field>
            <field name="model">stock.picking.out</field>
            <field name="inherit_id" ref="stock.view_picking_out_tree"/>
            <field name="arch" type="xml">
                <xpath expr='//tree[@string="Delivery Orders"]' position='attributes'>
            <attribute name="create">false</attribute>    
        </xpath>
            </field>
</record>

Is possible do this depending of group and state?

After this I tried:

<record id="view_picking_out_tree_change" model="ir.ui.view">
            <field name="name">stock.picking.out.tree.change</field>
            <field name="model">stock.picking.out</field>
        <field name="inherit_id" ref="stock.view_picking_out_tree"/>
        <field name="groups_id" eval="[(6, 0, [ref('gestao_ideias.group_gestao_ideias_manager')])]"/>
            <field name="arch" type="xml">
                <xpath expr='//tree[@string="Delivery Orders"]' position='attributes'>
            <attribute name="create">false</attribute>
        </xpath>
            </field>
 </record>

I have two groups:

gestao_ideias.group_gestao_ideias_system_manager

acess_gestao_ideias9,gestao.ideias,model_gestao_ideias,group_gestao_ideias_system_manager,1,1,1,1

gestao_ideias.group_gestao_ideias_manager

acess_gestao_ideias10,gestao.ideias,model_gestao_ideias,group_gestao_ideias_manager,1,1,1,0

This solution also doesn't work. But if I change field name="groups_id" for this:

<field name="groups_id" eval="[(6, 0, [ref('gestao_ideias.group_gestao_ideias_system_manager')])]"/>

Works! Why? In this case the user with more permissions don't have a button create but other user have.

Thanks.

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

1 follower(s)

Stats

Asked: 7/26/13, 8:00 AM
Seen: 1239 times
Last updated: 3/16/15, 8:10 AM