details:   https://code.tryton.org/tryton/commit/0a52eb4a6a12
branch:    default
user:      Cédric Krier <[email protected]>
date:      Mon Jan 05 11:52:11 2026 +0100
description:
        Test if identifier is not empty before testing if it is Belgian VAT for 
PEPPOL

        Closes #14464
diffstat:

 modules/edocument_peppol/account.py |  7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diffs (17 lines):

diff -r b96191427ff3 -r 0a52eb4a6a12 modules/edocument_peppol/account.py
--- a/modules/edocument_peppol/account.py       Tue Dec 23 12:07:17 2025 +0100
+++ b/modules/edocument_peppol/account.py       Mon Jan 05 11:52:11 2026 +0100
@@ -21,9 +21,10 @@
     @property
     def peppol_required(self):
         def is_be_vat(identifier):
-            return (identifier.type == 'be_vat'
-                or (identifier.type == 'eu_vat'
-                    and identifier.code.startswith('BE')))
+            return (identifier
+                and (identifier.type == 'be_vat'
+                    or (identifier.type == 'eu_vat'
+                        and identifier.code.startswith('BE'))))
         if (self.invoice_date
                 and self.invoice_date.year >= 2026
                 and is_be_vat(self.tax_identifier)

Reply via email to