Hello!
I added a field (consultants_ids) to the "account.analytic.account" model where i can choose some employees and give them access to some of the analytic accounts. Now, i am trying to use a domain on the "analytic_account_id" in the "hr.expense model" in order to show only the accounts that have been connected to the user selected in the "employee_id" field.
Thank you!
PS:
i tried
<xpath expr="//field[@name='analytic_account_id']" position='replace'>
<field name="analytic_account_id" groups="base.group_user" domain="[('consultants_ids.user_id', '=', uid)]" string="Project" attrs="{'readonly':[('state','not in',['draft'])]}"/>
</xpath>
but this only shows the accounts for the logged in user.
I also tried this, but then no analytic accounts appear in the fields
<xpath expr="//field[@name='analytic_account_id']" position='replace'>
<field name="analytic_account_id" groups="base.group_user" domain="[('consultants_ids.user_id', '=', 'employee_id)]" string="Project" attrs="{'readonly':[('state','not in',['draft'])]}"/>
</xpath>