[FIX] stock: apply all returning a wizard

When using the "Apply All" button to make inventory adjustments, a
wizard is opened to choose a name. Then, this wizard calls the quant's
`action_apply_inventory` method but doesn't return it.
But sometime, this method doesn't apply immediately the inventory but
ask for confirmation before (e.g.: trying to "Apply All" with quants for
tracked product but without lot/serial number).
In these cases, the "Apply All" does nothing.

closes odoo/odoo#104307

X-original-commit: e555333cf3ca2511df55105a027ca52e55c13774
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
This commit is contained in:
svs-odoo
2022-10-27 15:41:26 +02:00
parent 64d48616c9
commit b3b89745f6
@@ -21,4 +21,4 @@ class StockInventoryAdjustmentName(models.TransientModel):
def action_apply(self):
quants = self.quant_ids.filtered('inventory_quantity_set')
quants.with_context(inventory_name=self.inventory_adjustment_name).action_apply_inventory()
return quants.with_context(inventory_name=self.inventory_adjustment_name).action_apply_inventory()