Suppose a product P with an available quantity equal to 1. Suppose a user writes on an existing SML for that product and sets the reserved quantity to 2. When writing on such a field, `StockMoveLine.write` tries to reserve the same quantity on the quants. If it fails (which would be the case here because there is only one P available), the reserved quantity of the SML is reset to 0 (and so does the reserved quantity of the quant). https://github.com/odoo/odoo/blob/b8423ba218e0736593c3329d7438ca09112a735f/addons/stock/models/stock_move_line.py#L301-L313 However, there is an issue: the incorrect reserved quantity is still in `vals`. As a result, later on in the method, this incorrect value is written on the SML: https://github.com/odoo/odoo/blob/b8423ba218e0736593c3329d7438ca09112a735f/addons/stock/models/stock_move_line.py#L362 This creates an inconsistency: a SML affirms that 2 x P are reserved while the reserved quantity of the quant is 0. Moreover, when marking the SML as done, it will lead to a "unreserve more than..." issue. OPW-2936689 closes odoo/odoo#100858 X-original-commit: 2ea52bbcdbc2beaac916fa5f127ffc0ab2650708 Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com> Signed-off-by: Adrien Widart <awt@odoo.com>