[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 Marçal Isern
parent e652a4a6ac
commit cdacd28064
2 changed files with 6 additions and 5 deletions

View File

@@ -14,13 +14,13 @@ msgstr ""
"Plural-Forms: \n"
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_invoice.py:119
#: code:addons/account_payment_order/models/account_invoice.py:120
#, python-format
msgid "%d payment lines added to the existing draft payment order %s."
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_invoice.py:114
#: code:addons/account_payment_order/models/account_invoice.py:115
#, python-format
msgid "%d payment lines added to the new draft payment order %s which has been automatically created."
msgstr ""
@@ -742,13 +742,13 @@ msgid "No Journal Entry on invoice %s"
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_invoice.py:86
#: code:addons/account_payment_order/models/account_invoice.py:87
#, python-format
msgid "No Payment Line created for invoice %s because it already exists or because this invoice is already paid."
msgstr ""
#. module: account_payment_order
#: code:addons/account_payment_order/models/account_invoice.py:92
#: code:addons/account_payment_order/models/account_invoice.py:93
#, python-format
msgid "No Payment Mode on invoice %s"
msgstr ""

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: