By 'not work' you probably mean that the partners are not determined.
What have you tried so far?
Did you go through the standard customizing for customer hierarchy - e.g. check document type assignments for this hierarchy?
Did you compare the partner determination procedures?
Did you check the functional documentation for custom developments for that?