3

e. The issue i am facing is that i need to show a field to multiple user groups. I know how to show field to one group

<field name="received_qty" groups="base.test_group" string="Total Received Quantity"/>

but i want to show this field to multiple groups (suppose :'base.group1','base.group2') and then it should be hidden from all other groups which are not listed here

Ahsan Attari
  • 987
  • 3
  • 12
  • 26

1 Answers1

4

Using , operator we can give groups name in field as many as we want.

For example:

groups="base.test_group,base.test_group1,base.test_group2"

It's combination of module_name.xml_group_id. Field can be visible for those User who has group checked.

Bhavesh Odedra
  • 10,990
  • 12
  • 33
  • 58
  • what if i want this field to be invisible for multiple groups because in attrs="{'invisible':groups}" is not allowed – Ahsan Attari Jun 30 '17 at 13:23
  • 1
    For that you can make one function field which will return True if you want to display that field User otherwise False. Afterwards, that field give in *attrs=* – Bhavesh Odedra Jun 30 '17 at 13:32