# Disable new/delete butons in o2m widget without define access rules

**URL:** https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536
**Category:** Developer
**Created:** [December 10, 2020, 9:07am UTC](https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536 "2020-12-10T09:07:06Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![resteve](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/resteve/32/823_2.png) [@resteve](https://discuss.tryton.org/u/resteve)
#### Post date: [December 10, 2020, 9:07am UTC](https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536/1 "2020-12-10T09:07:06Z")

</div>

In o2m field, I like to disable new and delete buttons, but not edit current records.

Is it possible without define a read/delete access rule (group user)?

---

<div class="post-metadata">

### Author: ![sergyo](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/sergyo/32/181_2.png) [@sergyo](https://discuss.tryton.org/u/sergyo)
#### Post date: [December 10, 2020, 9:24am UTC](https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536/2 "2020-12-10T09:24:54Z")

</div>

I think this is the behaviour if you define readonly=True on o2m field.

---

<div class="post-metadata">

### Author: ![resteve](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/resteve/32/823_2.png) [@resteve](https://discuss.tryton.org/u/resteve)
#### Post date: [December 14, 2020, 10:50am UTC](https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536/3 "2020-12-14T10:50:40Z")

</div>

readonly attribute in field, new/edit/remove buttons are activated in o2m widget (not dissabled):

- new. All fields is readonly. Ok.
- edit All fields are editable. Ok
- remove. You could remove a line. Ko.

I understand that “readonly” attribute is only to read, no edit and not delete.

About documentation:

> If True, the field is not editable in the client. Default is False.

[https://docs.tryton.org/projects/server/en/latest/ref/models/fields.html#trytond.model.fields.Field.readonly](https://docs.tryton.org/projects/server/en/latest/ref/models/fields.html#trytond.model.fields.Field.readonly)

---

<div class="post-metadata">

### Author: ![resteve](https://discuss-cdn.tryton.org/user_avatar/discuss.tryton.org/resteve/32/823_2.png) [@resteve](https://discuss.tryton.org/u/resteve)
#### Post date: [December 14, 2020, 10:56am UTC](https://discuss.tryton.org/t/disable-new-delete-butons-in-o2m-widget-without-define-access-rules/3536/4 "2020-12-14T10:56:02Z")

</div>

> [@resteve](#):
>
> ew/edit/remove buttons are activated in o2m widget (not dissabled):
> 
> - new. All fields is readonly. Ok.
> - edit All fields are editable. Ok
> - remove. You could remo

Ups! I do a mistake in XML. Is readonly=“1” and not readonly=“True”.
