[FIX] better filtering of move lines already included in open payment order

This commit is contained in:
Stéphane Bidoul
2016-06-26 11:23:36 +02:00
parent 6849beab0e
commit 7f7b081539

View File

@@ -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]