Update domain value depending on chosen user input


Any help is much appreciated.

Through the UI I am getting the user to choose from a dropdown field. Depending on the dropdown field value chosen, I want it to affect which data another dropdown field will show.

As can be seen in the code below I am looking to get the ‘roleSelection’ value into the ‘domain=“self.roles.name=roleSelection”’. Both elements are contained within the same domain and view.

The way shown does not work, any help or pointers into how to get this somewhat simply functionality to work would be much appreciated!

Dropdown 01:

<many-to-one name="roleSelection" ref="com.axelor.auth.db.Role" title="Role" />


        <field name="roleSelection" form-view="role-form" grid-view="role-grid" colSpan="6" required="true" />

Dropdown 02:

    <many-to-one name="manager" ref="com.axelor.auth.db.User" title="Manager"/>


<field name="manager" grid-view="user-grid" form-view="user-form" domain="self.roles.name=roleSelection" readonlyIf="!roleSelection"></field>

you have to pass context to next view and filter on that based on domain

Hi Siddique,

Thanks for getting back. I’m not fully understanding what you mean - would you be able to give some more info.

Thanks a mill.

I have not tried but I feel

“user-form” domain="self.roles.name=:role context=_role=roleName

clear or I will try with actual case asap

2 J'aimes

HI Siddique,

Thanks again for getting back. Unfortunately this doesn’t seem to do the trick - or possibly I am implementing it wrong. I will report back if I manage to find a solution in case anyone else is needing in future.

You can use :roleSelection MEMBER OF self.roles

2 J'aimes