Files
tryton/modules/stock_consignment/account.py
T

23 lines
725 B
Python
Raw Normal View History

2017-06-24 10:40:28 +02:00
# This file is part of Tryton. The COPYRIGHT file at the top level of
# this repository contains the full copyright notices and license terms.
2021-12-11 17:58:44 +01:00
from trytond.pool import Pool, PoolMeta
2017-06-24 10:40:28 +02:00
2018-06-26 19:11:55 +02:00
class InvoiceLine(metaclass=PoolMeta):
2017-06-24 10:40:28 +02:00
__name__ = 'account.invoice.line'
@property
def origin_name(self):
pool = Pool()
Move = pool.get('stock.move')
name = super(InvoiceLine, self).origin_name
if (isinstance(self.origin, Move)
and self.origin.id >= 0
2017-06-24 10:40:28 +02:00
and self.origin.shipment):
name = self.origin.shipment.rec_name
return name
@classmethod
def _get_origin(cls):
return super(InvoiceLine, cls)._get_origin() + ['stock.move']