0

view.xml

<field name="planning_id"/>
<field name="employee"/>
<field name="job_position" />

I want to display the job_position which is matched with the similar companies of planning_id(job_position.company_id=planning_id.company). I tried with domain but its not working.

<field name="job_position" domain="'company_id'=planning_id.company_id"/>
KbiR
  • 4,047
  • 6
  • 37
  • 103
Mani
  • 2,675
  • 2
  • 20
  • 42

1 Answers1

0

First of all you need to create a related field to have the company in the same model, so, in the .py of your model:

company_id = fields.Many2one(related='planning_id.company_id')

Then, in the view:

<field name="job_position" domain="[('company_id', '=', company_id)]"/>
dccdany
  • 826
  • 7
  • 17