I added a new field to the res.partner model as follow:
beneficiary_ids = fields.Many2many('res.partner', 'res_partner_beneficiaries_rel', column1='col_1_partner', column2='col_2_beneficiary', ondelete='cascade' )
That's because each contact can have many beneficiaries and each beneficiary can be included in many contacts.
So, I can add some beneficiaries to a contact.
In another view in another module at first, I select a contact, and in the next field, I want to choose one of its beneficiaries. So, I need to filter contacts to see just the selected contact's beneficiaries in the previous field.
My questions:
1) Is the Many2many relation correct(or such relation should be Many2one?why?)?
2) And, How can I set the right filter/domain? Now, I see all contacts in the second field.