From 7309e38115c6f14ec3f2ccc8fc0f8a800ecb762f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Sat, 22 Jul 2023 16:37:00 +0200 Subject: [PATCH] Test also the amount of invoice lines without product to compute the UNCEFACT type Closes #12426 --- modules/edocument_uncefact/edocument.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/edocument_uncefact/edocument.py b/modules/edocument_uncefact/edocument.py index 7b6776c53b..28d257ed02 100644 --- a/modules/edocument_uncefact/edocument.py +++ b/modules/edocument_uncefact/edocument.py @@ -89,12 +89,12 @@ class Invoice(Model): @cached_property def type_code(self): if self.invoice.type == 'out': - if all(l.amount < 0 for l in self.lines if l.product): + if all(l.amount < 0 for l in self.lines): return '381' else: return '380' else: - if all(l.amount < 0 for l in self.lines if l.product): + if all(l.amount < 0 for l in self.lines): return '261' else: return '389'