Modulo an inessential detail, we are asked to generate mixed radix numbers with certain "digit" sums $k=k_1+\ldots+k_m$. In particular, given $\mathbf{k_i}$ satisfying the sum of components $k$, we are asked to find either the next larger representation having the same component sum, or if none exists, the smallest representation having component sum $k+1$, which we call $\mathbf{k_{i+1}}$.
Asking for the "next" $\mathbf{k_i}$ only makes sense if an ordering is imposed among solutions with a fixed component sum $k$. We will assume a lexicographic ascending order below, but a descending order would be as easy to arrange.
The basic idea is clear enough: find the rightmost (maximum) index $j$ such that we can increment $k_j$ by one and (in compensation) decrease by one the sum of components with index greater than $j$ in the way that represents the smallest possible ($m-j$ component) mixed radix number (with the specified component sum).
The "boundary" case where no such index $j$ is possible, so that we increment $k$ and start over with the smallest possible mixed radix number with component sum $k+1$, is essentially the same as the latter subproblem of the typical step. It therefore bears discussing how to find the smallest number with a given sum $k$ of entries.
Fortunately this subproblem has an easy solution: we choose digits from right to left in a greedy fashion, as large as possible subject to the constrained sum $k$.
This is good point to pin down the inessential detail mentioned at the outset. The Question poses a sum of components $k_i \in \{1,\ldots,K_i\}$ (although confusingly, the condition $k_i \ge 0$ is also stated). If the components are all required to meet $k_i \ge 1$ (or for that matter any other nonzero lower bounds, possibly determined by the index $i$), we cannot achieve any sum of components less than $m$ (seeing as there are $m$ components to be added).
Therefore it is convenient to subtract one from each component, choosing instead that $k_i \in \{0,\ldots,K_i-1\}$, which makes the analogy with mixed radix representations more explicit. Correspondingly, the digit sums can then progress from $\sum_{i=1}^m k_i = 0$ to $\sum_{i=1}^m (K_i - 1)$.
Least representation of rightmost $m-j$ digits having component sum $c$
Set $\ell = m$.
While $\ell > j$:
- Set $k_\ell = \max \{c, K_\ell - 1 \}$.
- Set $c = c - k_\ell$.
- Set $\ell = \ell - 1$.
Return success if $c = 0$, otherwise fail.
Find rightmost index $j$ such that $k_j$ can be incremented
Scan from right to left to find an index $j \gt 1$ such that $k_j \gt 0$.
If no such index exists, fail.
Do:
Until $k_j \lt K_j - 1$.
For efficiency we can keep a running sum $c$ of entries above index $j$, since we will offset the increment of $k_j$ by decrementing the sum $c$ of components beyond that point.