Merge pull request #552 from acsone/12.0-ref_payment_order_invoice_add_to_order_tbi

[12.0] [REF] Payment Order: allow add to order from invoice if order exists
This commit is contained in:
Pedro M. Baeza
2019-02-19 17:57:34 +01:00
committed by GitHub

View File

@@ -79,7 +79,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: