changeset a946571d6528 in modules/sale_advance_payment:default
details: 
https://hg.tryton.org/modules/sale_advance_payment?cmd=changeset&node=a946571d6528
description:
        Fill origin name of invoice line from condition

        issue10728
        review376021002
diffstat:

 CHANGELOG  |  1 +
 account.py |  9 +++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diffs (27 lines):

diff -r 921b48a965ce -r a946571d6528 CHANGELOG
--- a/CHANGELOG Sun Apr 10 19:11:39 2022 +0200
+++ b/CHANGELOG Tue Apr 12 10:31:27 2022 +0200
@@ -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 -r 921b48a965ce -r a946571d6528 account.py
--- a/account.py        Sun Apr 10 19:11:39 2022 +0200
+++ b/account.py        Tue Apr 12 10:31:27 2022 +0200
@@ -68,6 +68,15 @@
             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()

Reply via email to