1

I have a button on treeview in my xml file and, I want to disable button for a few records not all but I don't know how??? I used invisible = (condition) but it didn't work correctly because invisible attribute hides column for all records, I used readonly attribute too but reason was the same. :( can someone help me??

1 Answers1

0

first: if you want to hide buttons from some users you need to make group security

<record model="res.groups" id="custom_group">
    <field name="name">Custom Group</field>
    <field name="users" eval="[(4, ref('base.group_user'))]"/>
</record>

second : add this line to what you want ti hide

...........groups="custom_group"

or you can do that with css like this ..... "display:none", But this is a way that will be temporary and ineffective.

  • Hi. thanks for your attention but I want to disable it depends on some other field in record. In other words this button does action that I want call it once for each record if button is called so button should be disable but I couldn't find the solution... – reyhane janboori Sep 07 '22 at 04:34
  • if you want to disable it depends on some other field in record. this will hide it from all users – Said Gourida Sep 07 '22 at 15:06