details: https://code.tryton.org/tryton/commit/a3687847e025
branch: 7.8
user: Cédric Krier <[email protected]>
date: Tue Jan 27 12:01:42 2026 +0100
description:
Test if origin id is greater or equals to 0 before accessing the target
record name
Closes #13498
(grafted from ca37026b228e56df6ed3455005a6bcd23a5665f0)
diffstat:
modules/account_invoice/invoice.py | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diffs (13 lines):
diff -r 043aa7d8d8ef -r a3687847e025 modules/account_invoice/invoice.py
--- a/modules/account_invoice/invoice.py Mon Feb 02 13:53:44 2026 +0100
+++ b/modules/account_invoice/invoice.py Tue Jan 27 12:01:42 2026 +0100
@@ -2712,7 +2712,8 @@
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):