Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
5 Ответы
27628 Представления

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>

Аватар
Отменить