I am not sure of the full answer but here is an indication of which one is acceptable:
He knows the woman whom we bought the cellphone yesterday
He is object, whom is indirect object also relative pronoun
The relative pronouns are:
who, whom, whose, that, and which
Who and whom both refer to persons. Who is the subject such as 'the person who was just speaking' and whom refers to the object such as 'the person whom I drove to the station'
These example were taken from book "A Grammar Companion for Primary Teachers."
Hope this helps
- For Teachers