From b056deb7ab7c533662e7eb1ec7a8fcb586a2daed Mon Sep 17 00:00:00 2001 From: William Henrotin Date: Tue, 28 Mar 2023 14:27:37 +0000 Subject: [PATCH] [FIX] stock_picking_batch: do not confirm multiple times Commit 324298967cb6 fix the call to _find_auto_batch() by calling _action_confirm() of the picking _after_ the assignation. This implies to confirming 2 times the pickings. Which is an issue in case an automatic orderpoint is searched and triggered. to fullfill the need in the source location. This commit change the call to action_confirm() to a call to _find_auto_batch() only closes odoo/odoo#117100 X-original-commit: eb6da7009a525665d4608243e260a2d07093abcc Signed-off-by: William Henrotin (whe) --- addons/stock_picking_batch/models/stock_move.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/stock_picking_batch/models/stock_move.py b/addons/stock_picking_batch/models/stock_move.py index 5e12cb0a327..08566c9ef9e 100644 --- a/addons/stock_picking_batch/models/stock_move.py +++ b/addons/stock_picking_batch/models/stock_move.py @@ -23,5 +23,6 @@ class StockMove(models.Model): return res def _assign_picking_post_process(self, new=False): - super(StockMove, self)._assign_picking_post_process(new=new) - self.picking_id.action_confirm() + super()._assign_picking_post_process(new=new) + for picking in self.picking_id: + picking._find_auto_batch()