[FIX] contract: consistency between contract count and contract action
[FIX] contract: consistency between contract count and contract action

On the commercial entity, the count shows all contracts of child partners.
However clicking on the action might show no contract, as the action only
restricted the domain to the partner itself.
We extract the domain into a function to share it in both cases.

OCA/contract,OCA/contract,OCA/contract