Create mirror action
This commit is contained in:
@@ -2326,13 +2326,25 @@ class Invoice(metaclass=PoolMeta):
|
||||
if not trade:
|
||||
return ''
|
||||
incoterm = trade.incoterm.code if getattr(trade, 'incoterm', None) else ''
|
||||
location = (
|
||||
trade.incoterm_location.party_name
|
||||
if getattr(trade, 'incoterm_location', None) else ''
|
||||
)
|
||||
if incoterm and location:
|
||||
return f"{incoterm} {location}"
|
||||
return incoterm or location
|
||||
if not incoterm:
|
||||
return ''
|
||||
if incoterm.upper() not in {'CIF', 'CFR', 'CIP'}:
|
||||
return incoterm
|
||||
parts = [incoterm]
|
||||
to_location = getattr(trade, 'to_location', None)
|
||||
if to_location:
|
||||
location = (
|
||||
getattr(to_location, 'party_name', None)
|
||||
or getattr(to_location, 'rec_name', None)
|
||||
or getattr(to_location, 'name', None)
|
||||
)
|
||||
if location:
|
||||
parts.append(location)
|
||||
country = getattr(to_location, 'country', None)
|
||||
country_name = getattr(country, 'name', None)
|
||||
if country_name:
|
||||
parts.append(country_name)
|
||||
return ' '.join(parts)
|
||||
|
||||
@property
|
||||
def report_proforma_invoice_number(self):
|
||||
|
||||
Reference in New Issue
Block a user