details: https://code.tryton.org/tryton/commit/e82ed7096d42
branch: 8.0
user: Cédric Krier <[email protected]>
date: Mon Sep 07 18:01:00 2026 +0200
description:
Test if the line's origin is an instance of ModelStorage before
accessing the record name
Closes #15072
(grafted from c51729392ebd3af4327e55dd7f1c195163f5b1cf)
diffstat:
modules/account_invoice/invoice.py | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (23 lines):
diff -r 3730bc1a7bfa -r e82ed7096d42 modules/account_invoice/invoice.py
--- a/modules/account_invoice/invoice.py Thu Sep 10 22:12:59 2026 +0200
+++ b/modules/account_invoice/invoice.py Mon Sep 07 18:01:00 2026 +0200
@@ -18,8 +18,8 @@
from trytond import backend, config
from trytond.i18n import gettext
from trytond.model import (
- ChatMixin, DeactivableMixin, Index, MatchMixin, ModelSQL, ModelView,
- Unique, Workflow, dualmethod, fields, sequence_ordered)
+ ChatMixin, DeactivableMixin, Index, MatchMixin, ModelSQL, ModelStorage,
+ ModelView, Unique, Workflow, dualmethod, fields, sequence_ordered)
from trytond.model.exceptions import AccessError
from trytond.modules.account.exceptions import AccountMissing
from trytond.modules.account.tax import TaxableMixin
@@ -2794,7 +2794,7 @@
def origin_name(self):
if isinstance(self.origin, self.__class__) and self.origin.id >= 0:
return self.origin.invoice.rec_name
- if self.origin and self.origin.id >= 0:
+ if isinstance(self.origin, ModelStorage) and self.origin.id >= 0:
return self.origin.rec_name
@classmethod