Fill origin name of invoice line from condition

issue10728
review376021002
This commit is contained in:
Cédric Krier
2022-04-12 10:31:27 +02:00
parent 3e5fb00bc7
commit f53e675abd
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -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
+9
View File
@@ -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()