From 13c6b70d1e42f3e6e009ac1dcde34ab3ddcc4454 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Sun, 26 Jun 2016 11:23:36 +0200 Subject: [PATCH] [FIX] better filtering of move lines already included in open payment order --- account_payment_order/wizard/account_payment_line_create.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/account_payment_order/wizard/account_payment_line_create.py b/account_payment_order/wizard/account_payment_line_create.py index f131db886..16fe79cbd 100644 --- a/account_payment_order/wizard/account_payment_line_create.py +++ b/account_payment_order/wizard/account_payment_line_create.py @@ -112,9 +112,11 @@ class AccountPaymentLineCreate(models.TransientModel): ('debit', '>', 0), ('account_id.internal_type', '=', 'receivable'), ] - # Exclude lines that are already in a non-cancelled payment order + # Exclude lines that are already in a non-cancelled + # and non-uploaded payment order; lines that are in a + # uploaded payment order are proposed if they are not reconciled, paylines = self.env['account.payment.line'].search([ - ('state', '!=', 'cancel'), + ('state', 'in', ('draft', 'open', 'generated')), ('move_line_id', '!=', False)]) if paylines: move_lines_ids = [payline.move_line_id.id for payline in paylines]