diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index 63fa58d2..50f128d9 100644 --- a/l10n_do_accounting/__manifest__.py +++ b/l10n_do_accounting/__manifest__.py @@ -8,7 +8,7 @@ "category": "Localization", "license": "LGPL-3", "website": "https://github.com/odoo-dominicana", - "version": "15.0.0.14.0", + "version": "15.0.0.14.1", # any module necessary for this one to work correctly "depends": ["l10n_latam_invoice_document", "l10n_do"], # always loaded diff --git a/l10n_do_accounting/models/account_move.py b/l10n_do_accounting/models/account_move.py index 19923219..45d35b44 100644 --- a/l10n_do_accounting/models/account_move.py +++ b/l10n_do_accounting/models/account_move.py @@ -185,8 +185,9 @@ def _l10n_do_is_new_expiration_date(self): ), ("posted_before", "=", True), ("id", "!=", self.id or self._origin.id), + ("l10n_do_ncf_expiration_date", "!=", False), ], - order="invoice_date, id desc", + order="invoice_date desc, id desc", limit=1, ) if not last_invoice: @@ -203,6 +204,7 @@ def _compute_l10n_do_show_expiration_date_msg(self): and inv.l10n_latam_document_type_id and inv.country_code == "DO" and not inv.l10n_latam_manual_document_number + and inv.l10n_do_ncf_expiration_date ) for invoice in l10n_do_internal_invoices: invoice.l10n_do_show_expiration_date_msg = invoice._l10n_do_is_new_expiration_date()