Every project is assigned a partner, the customer.
I have a new field 'customer_contacts' in the project entity.
The 'customer_contacts' should only show the contacts that are related to that customer.
But when I try to add the contacts to the project, they don't show up.
class Partner(models.Model):
_inherit = 'res.partner'
project_id = fields.Many2one(
'project.project',
)
class Project(models.Model):
_inherit = 'project.project'
partner_id = fields.Many2one('res.partner')
customer_contacts = fields.Many2many(
'res.partner',
domain=lambda self: [('id', 'in', self.partner_id.child_ids.ids or [] )]
)