details:   https://code.tryton.org/tryton/commit/3531f0cffe8e
branch:    7.8
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
        (grafted from 0a52eb4a6a126134ec5d667bbbb9507b59a49836)
diffstat:

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

diffs (17 lines):

diff -r 7d1609cc9dc8 -r 3531f0cffe8e modules/edocument_peppol/account.py
--- a/modules/edocument_peppol/account.py       Fri Jan 02 13:11:49 2026 +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