Searching for records is also a common operation in business logic methods. This recipe shows us how to find all the Partner companies and their contacts by company name.
Searching for records
Getting ready
This recipe will use the same simplified res.partner definition as the Creating new records recipe previously. You may refer to this simplified definition to know the fields.
We will write the code in a method called find_partners_and_contact(self, name).
How to do it...
In order to find the partners, you need to perform the following steps:
- Get an empty recordset...