From 49a2d609842fa2d6a11be1fb5546e41b8e0788a4 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Thu, 17 Oct 2024 15:58:56 +0200 Subject: [PATCH] [FIX] purchase_delivery_split_date: prevent error when adding a purchase order line on a different delivery date on confirmed POs For example: use the purchase request module to add a new line on an existing PO --- purchase_delivery_split_date/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/purchase_delivery_split_date/models/purchase.py b/purchase_delivery_split_date/models/purchase.py index cd66fb581e9..2069746f861 100644 --- a/purchase_delivery_split_date/models/purchase.py +++ b/purchase_delivery_split_date/models/purchase.py @@ -132,7 +132,7 @@ def _check_split_pickings(self): continue if ( move.picking_id.scheduled_date.date() != date_key - or pickings_by_date[date_key] != move.picking_id + or pickings_by_date.get(date_key, []) != move.picking_id ): if date_key not in pickings_by_date: copy_vals = line._first_picking_copy_vals(key, line)