From f2fc646c4a5fec3d574f73cadc86b78dd8ef7b79 Mon Sep 17 00:00:00 2001 From: odooNextev Date: Fri, 6 Dec 2024 15:07:16 +0100 Subject: [PATCH] [FIX] l10n_it_delivery_note: check only on incoming picking presence to avoid DN invoicing --- l10n_it_delivery_note/models/stock_delivery_note.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/l10n_it_delivery_note/models/stock_delivery_note.py b/l10n_it_delivery_note/models/stock_delivery_note.py index eade81493a06..ebe1aa7fc04a 100644 --- a/l10n_it_delivery_note/models/stock_delivery_note.py +++ b/l10n_it_delivery_note/models/stock_delivery_note.py @@ -625,11 +625,8 @@ def _check_delivery_notes_before_invoicing(self): raise UserError( _("%s hasn't sale order!") % delivery_note_id.display_name ) - if ( - len( - delivery_note_id.mapped("sale_ids.picking_ids.picking_type_id.code") - ) - > 1 + if "incoming" in delivery_note_id.mapped( + "sale_ids.picking_ids.picking_type_id.code" ): raise UserError( _(