[REF] Payment Order: allow add to order from invoice if order exists

This commit is contained in:
Thomas Binsfeld
2019-02-06 17:34:16 +01:00
committed by Pedro M. Baeza
parent e0fc35d30b
commit 3dbe3686cd

View File

@@ -71,7 +71,8 @@ class AccountInvoice(models.Model):
lambda x: (
not x.reconciled and x.payment_mode_id.payment_order_ok and
x.account_id.internal_type in ('receivable', 'payable') and
not x.payment_line_ids
not any(p_state in ('draft', 'open', 'generated')
for p_state in x.payment_line_ids.mapped('state'))
)
)
if not applicable_lines: