From 551dffded7cec09db2785619bfed99693cb62f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 27 Jan 2026 12:01:42 +0100 Subject: [PATCH] Test if origin id is greater or equals to 0 before accessing the target record name Closes #13498 (grafted from ca37026b228e56df6ed3455005a6bcd23a5665f0) --HG-- branch : 7.0 --- modules/account_invoice/invoice.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/account_invoice/invoice.py b/modules/account_invoice/invoice.py index d85075c2e6..e45cd63e54 100644 --- a/modules/account_invoice/invoice.py +++ b/modules/account_invoice/invoice.py @@ -2456,7 +2456,8 @@ class InvoiceLine(sequence_ordered(), ModelSQL, ModelView, TaxableMixin): def origin_name(self): if isinstance(self.origin, self.__class__) and self.origin.id >= 0: return self.origin.invoice.rec_name - return self.origin.rec_name if self.origin else None + if self.origin and self.origin.id >= 0: + return self.origin.rec_name @classmethod def default_taxes_deductible_rate(cls):