In your lectures, the following entries are indicated for the removal of unrealised profit.
When parent sells to associate: Dr Group retained earnings Cr Investment in associate
When associate sells to parent Dr Group RE/Share of profit of associate Cr. Group inventory
However, in BPP and Kaplan books there is no difference between upstream and downstream transactions. The same following entry is indicated for both transactions.
Dr Share of profit of associate Cr. Investment in associate.