From 51a38d1dd633089e63e0e2bd54faaaf7fb8a10c7 Mon Sep 17 00:00:00 2001 From: Jacques-Etienne Baudoux Date: Fri, 3 Jan 2025 15:11:30 +0100 Subject: [PATCH] [FIX] partner_invoicing_mode_cash_on_delivery Do not trigger invoicing on internal operations --- .../models/stock_picking.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py b/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py index d9b447b6cd2..5a2774c950a 100644 --- a/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py +++ b/partner_invoicing_mode_cash_on_delivery/models/stock_picking.py @@ -28,7 +28,10 @@ def _invoice_at_shipping(self): """ self.ensure_one() res = super()._invoice_at_shipping() - res = res or self.sale_id.payment_mode_id.cash_on_delivery + res = res or ( + self.picking_type_code == "outgoing" + and self.sale_id.payment_mode_id.cash_on_delivery + ) return res def _invoicing_at_shipping_validation(self, invoices):