From e9edfa6ddf12e0800c83f0bcae383ffc84da5b7a Mon Sep 17 00:00:00 2001 From: Lopsanz Date: Tue, 24 Mar 2020 12:19:28 +0100 Subject: [PATCH] [FIX] Considering in-payment state and more info in alerts --- .../i18n/account_invoice_constraint_chronology.pot | 10 ++++++---- .../model/account_invoice.py | 3 ++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/account_invoice_constraint_chronology/i18n/account_invoice_constraint_chronology.pot b/account_invoice_constraint_chronology/i18n/account_invoice_constraint_chronology.pot index 763825547..9a31f54e1 100644 --- a/account_invoice_constraint_chronology/i18n/account_invoice_constraint_chronology.pot +++ b/account_invoice_constraint_chronology/i18n/account_invoice_constraint_chronology.pot @@ -6,6 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-03-06 10:58+0000\n" +"PO-Revision-Date: 2020-03-06 10:58+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -19,15 +21,15 @@ msgid "Check Chronology" msgstr "" #. module: account_invoice_constraint_chronology -#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:53 +#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:54 #, python-format -msgid "Chronology Error. Please confirm older draft invoices before {date_invoice} and try again." +msgid "Chronology Error. Please confirm older draft invoices before {date_invoice} and try again. First occurrence is {invoice_number}." msgstr "" #. module: account_invoice_constraint_chronology -#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:69 +#: code:addons/account_invoice_constraint_chronology/model/account_invoice.py:72 #, python-format -msgid "Chronology Error. There exist at least one invoice with a later date to {date_invoice}." +msgid "Chronology Error. There exist at least one invoice with a later date to {date_invoice}.First occurrence is {invoice_number}." msgstr "" #. module: account_invoice_constraint_chronology diff --git a/account_invoice_constraint_chronology/model/account_invoice.py b/account_invoice_constraint_chronology/model/account_invoice.py index 1eab68a64..a5ac78266 100644 --- a/account_invoice_constraint_chronology/model/account_invoice.py +++ b/account_invoice_constraint_chronology/model/account_invoice.py @@ -17,6 +17,7 @@ class AccountInvoice(models.Model): ('state', 'not in', ['open', 'paid', 'cancel', + 'in_payment', 'proforma', 'proforma2']), ('date_invoice', '!=', False), @@ -27,7 +28,7 @@ class AccountInvoice(models.Model): @api.model def _prepare_later_invoices_domain(self, invoice): return [ - ('state', 'in', ['open', 'paid']), + ('state', 'in', ['open', 'in_payment', 'paid']), ('date_invoice', '>', invoice.date_invoice), ('journal_id', '=', invoice.journal_id.id), ]