Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
5 Răspunsuri
27627 Vizualizări

Hello Odoo masterss, I'm currently using Odoo8 and I'm wondering whether i can remove the "Delete" function inside "More" button in back-end and by specific role?

Hope to remove all "Delete" function from that role.
(X) I've tried set rules through back-end for that particular user, even at the front-end appeared the new rule that I've created but the "Delete" button still there and functioning.

Please thankyou.

Urgent.

Imagine profil
Abandonează
Cel mai bun răspuns

Simply Use the Delete attribute in form Tag

<form string="Registration Form" delete="false">
​<tree string="Registration Tree View" delete="false">

If it's work for you Please 1+ vote :)

Imagine profil
Abandonează

Works on v10, thank you.

Cel mai bun răspuns

Hello, through by code You can do it by writing security and access rights in csv 

<xpath expr="//tree" position="attributes">

    <attribute name="delete">false</attribute>

</xpath>


for group

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

<field name="arch" type="xml">

<xpath expr="//form" position="attributes">

<attribute name="delete">true</attribute>

</xpath>

</field>

If you want to hide or show, inherit JS code of that button and then give condition to it.

Imagine profil
Abandonează
Cel mai bun răspuns

Hi,

Suppose if you have to remove the delete option from the purchase order for the users purchase user, then what you have to do is that, activate developer mode, then go to the menu, Groups under the settings, then search the group purchase user. Open it, then in the access rights tab, you can see different objects and given permission.


From this for the object Purchase order untick the delete access, then for this group of users there will not delete permission.



In above image you can see that the delete access have been removed.


Now when log in as purchase user,



In the action drop down , you cannot see the Delete button.


The image is of v10, still you can follow same in v8.


Thanks

Imagine profil
Abandonează
Cel mai bun răspuns

thanks for the answer

Imagine profil
Abandonează
Cel mai bun răspuns

I hope it helps:

<record id="partner_tree_no_delete" model="ir.ui.view">

    <field name="name">partner.tree.no.delete</field>

    <field name="model">res.partner</field>

    <field name="inherit_id" ref="base.view_partner_tree" />

    <field name="arch" type="xml">

        <xpath expr="//tree" position="attributes">

            <attribute name="delete">false</attribute>

        </xpath>

    </field>

</record>

Imagine profil
Abandonează