From ed6d78edcc26b1083e5b39e07cfce842f75bd626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20L=C3=B3pez?= Date: Mon, 26 Feb 2024 14:07:20 -0400 Subject: [PATCH] [FIX] l10n_do_accounting: TypeError if not ncf expiration date --- l10n_do_accounting/__manifest__.py | 2 +- l10n_do_accounting/models/account_move.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/l10n_do_accounting/__manifest__.py b/l10n_do_accounting/__manifest__.py index a995eeeff..5ce098380 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": "14.0.2.19.0", + "version": "14.0.2.19.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 9965a8c90..532adb761 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()