To write the partner manipulation methods, you need to perform the following steps:
- Define a method called get_email_addresses():
@api.model def get_email_addresses(self, partner):
- Call mapped() to get the email addresses of the contacts of the partner:
return partner.mapped('child_ids.email')
- Define a method called get_companies():
@api.model def get_companies(self, partners):
- Call mapped() to get the different companies of the partners:
return partners.mapped('parent_id')