Hi,
Would appreciate assistance in this.
Objective
- Filter a list of possible departments based on the current user_id
Setup
- There are 3 models illustrated below
class RiskUnit
...
department_lines = one2Many('riskunit.memberlines', 'department_id')
class RiskUnitMemberLines
..
user_id = many2One('res.users', 'User')
department_id = many2One('risk.unit', 'department')
class OperationalRisk
...
department_id = many2One('risk.unit', string = 'Department')
In the form view field for Operational risk, I tried to filter the available departments based on the user.id but was unsuccessful. Appreciate assistance on this
I tried the following in the views.xml file
field name="department_id" domain="[( 'department_lines.user_id' ,'=' , 'user.id' )]"
&
field name="department_id" domain="[( 'department_lines.user_id' ,'in' , 'user.id' )]"
but both returned an empty set of departments