Change self.origin.__name__ for isinstance(self.origin, ...)

This commit refs #25971


(cherry picked from commit aa955cc274)

(cherry picked from commit ddeb7f023c)
This commit is contained in:
ramon.vidal 2023-02-17 11:20:51 +01:00 committed by Sergio Morillo
parent 42bc640315
commit 1ec9b69668
1 changed files with 3 additions and 1 deletions

View File

@ -9,7 +9,9 @@ class InvoiceLineSaleInfo(metaclass=PoolMeta):
__name__ = 'account.invoice.line'
def get_shipment_out_numbers(self, name=None):
if self.origin and self.origin.__name__ == 'sale.cost':
SaleCost = Pool().get('sale.cost')
if self.origin and isinstance(self.origin, SaleCost):
shipments = set([shipment.rec_name
for shipment in self.origin.document.shipments])
return ','.join(sorted(shipments))