[FIX] purchase_stock: confirm push pickings
When creating a Purchase Order with multi-step reception, the pickings created by the push rules won't get confirmed as they should be (like in the sales multi-step flow). This creates issues further down with auto-batch as created pickings don't get auto-batched even if the picking type is set to do it. Task-2971346 X-original-commit: dc517bbe7ffbae8a8774f705c9431dce45c461ba Part-of: odoo/odoo#102382
This commit is contained in:
@@ -245,7 +245,9 @@ class PurchaseOrder(models.Model):
|
||||
seq += 5
|
||||
move.sequence = seq
|
||||
moves._action_assign()
|
||||
pickings.action_confirm()
|
||||
# Get following pickings (created by push rules) to confirm them as well.
|
||||
forward_pickings = self.env['stock.picking']._get_impacted_pickings(moves)
|
||||
(pickings | forward_pickings).action_confirm()
|
||||
picking.message_post_with_view('mail.message_origin_link',
|
||||
values={'self': picking, 'origin': order},
|
||||
subtype_id=self.env.ref('mail.mt_note').id)
|
||||
|
||||
Reference in New Issue
Block a user