From f53e675abd72d0dec4701abcaf4511ef42d3823e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Tue, 12 Apr 2022 10:31:27 +0200 Subject: [PATCH] Fill origin name of invoice line from condition issue10728 review376021002 --- CHANGELOG | 1 + account.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3809d8abee..1c127e726e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,4 @@ +* Fill origin name of invoice line from condition * Add support for Python 3.10 * Remove support for Python 3.6 * Recall advance payment with negative quantity diff --git a/account.py b/account.py index 3950d7b12b..4097cab040 100644 --- a/account.py +++ b/account.py @@ -68,6 +68,15 @@ class InvoiceLine(metaclass=PoolMeta): domain.append(('type.unearned_revenue', '=', True)) return domain + @property + def origin_name(self): + pool = Pool() + Condition = pool.get('sale.advance_payment.condition') + name = super().origin_name + if isinstance(self.origin, Condition): + name = self.origin.sale.rec_name + return name + @classmethod def _get_origin(cls): return (super(InvoiceLine, cls)._get_origin()