Steps to reproduce:
- Set warehouse to two-steps reception
- Create a BoM using a MTO (buy) component
- Create a MO for 2 units of that BoM
- Produce 1 and create a backorder
- Open the Overview
Issue:
When there is a backorder (or if the MO is splitted), then when browsing
the dests through `_rollup_move_dests()`, at some point it will branch
into two differents path, related to each backorders. This will raise a
traceback, as we only expected a single MO at that point.
To avoid this, we made the `_rollup_move_dests()` method batchable, so
we can fetch all moves linked to a manufacturing order in a single call,
avoiding this issue.
Note: For consistency sake, updated the `_rollup_move_origs()` method to
be batchable as well, to avoid confusion when using one or the other.
opw-3849252
closesodoo/odoo#161790
X-original-commit: d2830fccbe5dc733673d048303f573bb57a398a6
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>