تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
5 الردود
27674 أدوات العرض

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.

الصورة الرمزية
إهمال
أفضل إجابة

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 :)

الصورة الرمزية
إهمال

Works on v10, thank you.

أفضل إجابة

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.

الصورة الرمزية
إهمال
أفضل إجابة

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

الصورة الرمزية
إهمال
أفضل إجابة

thanks for the answer

الصورة الرمزية
إهمال
أفضل إجابة

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>

الصورة الرمزية
إهمال