Let $P(N,M,n)$ be the number of partitions of $n$ such that each term is $\le N$ and there are at most $M$ terms. So we know the generating function for $P(N,M,n)$ is $ \frac{(q)_{N+M}}{(q)_M (q)_{N}}$. Let $P_{sq}(n)$ be the partitions of $n$ such that all terms are perfect squares. The generating function for this would be $\prod \limits_{k \ge 1} 1/(1-q^{k^2})$. One can easily obtain a generating function for $P_{sq} (N^{2},n)$ where each term of the partition is $\le N^2$ by restricting $k$ from $1$ to $N$ in the generating function above.
So my question is that can we find a generating function for $P_{sq} (N^2,M,n)$? If yes, please tell me how.