Create mirror action

This commit is contained in:
2026-07-27 20:24:44 +02:00
parent 9429f7d2e3
commit 0ffd43149b
13 changed files with 710 additions and 38 deletions

View File

@@ -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):