I'm setting up a partner community for the first time.
I need to make sure Partner users will have access only to accounts, leads, opportunities and cases which are are created by them or someone from the same partner. In other words I don't want partner users seeing information of other partners but users of same partner should see each other records.
Internal users should of course see everything.
One way to achieve this is use the role hirerachy and keep the Partner community users below in the role hirerachy with private OWD .Since OWD is private no one will be able to access ,but since Grant access using hierarchy is ticked users above this role (Internal salesforce users in your case ) will have access to the records .
Note these all are standard objects hence Grant Access is ticked by default and cant be modified .
To allow all users of the same partner to see each other records you can write simple sharing rule to open up the access for the same role users .
In partner communities, a role is created for each partner account. Your best bet is probably apex manual sharing and a trigger on each object to share with other all users with the same role. There is quite likely an easier way, but this would work.