update commercial invoice template, moving customer code out to specific module:

This commit is contained in:
Marc Durepos 2025-04-10 10:25:14 -04:00
parent 57ba6be5b9
commit dd4062a0d3

View file

@ -19,15 +19,18 @@
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<tr> <tr>
<td width="33%"> <td width="33%">
<strong>Export Date / Date d'exportation:</strong><br/> <strong>Export Date / Date d'exportation:</strong>
<br/>
<span t-field="o.date"/> <span t-field="o.date"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Invoice # / No. de facture:</strong><br/> <strong>Invoice # / No. de facture:</strong>
<br/>
<span t-field="o.name"/> <span t-field="o.name"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Related Parties / Parties liées:</strong><br/> <strong>Related Parties / Parties liées:</strong>
<br/>
<span t-out="'Yes / Oui' if o.related_parties else 'No / Non'"></span> <span t-out="'Yes / Oui' if o.related_parties else 'No / Non'"></span>
</td> </td>
</tr> </tr>
@ -37,14 +40,18 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="50%"> <td width="50%">
<strong>Shipper/Exporter - Expéditeur/Exportateur:</strong><br/> <strong>Shipper/Exporter - Expéditeur/Exportateur:</strong>
<br/>
<div t-field="o.company_id.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/> <div t-field="o.company_id.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
<div t-if="o.company_id.vat">Tax ID: <span t-field="o.company_id.vat"/></div> <div t-if="o.company_id.vat">Tax ID: <span t-field="o.company_id.vat"/>
</div>
</td> </td>
<td width="50%"> <td width="50%">
<strong>Consignee - Destinataire:</strong><br/> <strong>Consignee - Destinataire:</strong>
<br/>
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/> <div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
<div t-if="o.partner_id.vat">Tax ID: <span t-field="o.partner_id.vat"/></div> <div t-if="o.partner_id.vat">Tax ID: <span t-field="o.partner_id.vat"/>
</div>
</td> </td>
</tr> </tr>
</table> </table>
@ -53,15 +60,18 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="33%"> <td width="33%">
<strong>Country of Export / Pays d'exportation:</strong><br/> <strong>Country of Export / Pays d'exportation:</strong>
<br/>
<span t-field="o.company_id.country_id.name"/> <span t-field="o.company_id.country_id.name"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Terms of Sale / Conditions de vente:</strong><br/> <strong>Terms of Sale / Conditions de vente:</strong>
<br/>
<span t-field="o.payment_term_id.name"/> <span t-field="o.payment_term_id.name"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Currency / Devise:</strong><br/> <strong>Currency / Devise:</strong>
<br/>
<span t-field="o.currency_id.name"/> <span t-field="o.currency_id.name"/>
</td> </td>
</tr> </tr>
@ -71,14 +81,17 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="50%"> <td width="50%">
<strong>Country of Origin / Pays d'origine:</strong><br/> <strong>Country of Origin / Pays d'origine:</strong>
<br/>
<t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/> <t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/>
<t t-set="origins" t-value="all_lines.mapped('product_id.country_of_origin.name')"/> <t t-set="origins" t-value="all_lines.mapped('product_id.country_of_origin.name')"/>
<span t-out="', '.join([x for x in origins if x])"/> <span t-out="', '.join([x for x in origins if x])"/>
</td> </td>
<td width="50%" rowspan="2"> <td width="50%" rowspan="2">
<strong>Importer of Record / Importateur attitré:</strong><br/> <strong>Importer of Record / Importateur attitré:</strong>
<span>(if different than consignee / si différent du destinataire)</span><br/> <br/>
<span>(if different than consignee / si différent du destinataire)</span>
<br/>
<t t-if="o.importer_id != o.partner_id"> <t t-if="o.importer_id != o.partner_id">
<div t-field="o.importer_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/> <div t-field="o.importer_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
</t> </t>
@ -86,7 +99,8 @@
</tr> </tr>
<tr> <tr>
<td> <td>
<strong>Country of Ultimate Destination / Pays de destination finale:</strong><br/> <strong>Country of Ultimate Destination / Pays de destination finale:</strong>
<br/>
<span t-field="o.partner_id.country_id.name"/> <span t-field="o.partner_id.country_id.name"/>
</td> </td>
</tr> </tr>
@ -96,25 +110,27 @@
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<thead> <thead>
<tr> <tr>
<th>Item # &amp; Description<br/>No. d'article &amp; description</th> <th name="item">Item # &amp; Description<br/>
<th>Client Item #<br/>No. d'article client</th> No. d'article &amp; description</th>
<th>HS #<br/>No. SH</th> <th>HS #<br/>
<th>Quantity<br/>Quantité</th> No. SH</th>
<th>Unit Value<br/>Valeur unitaire</th> <th>Quantity<br/>
<th>Total Value<br/>Valeur totale</th> Quantité</th>
<th>Unit Value<br/>
Valeur unitaire</th>
<th>Total Value<br/>
Valeur totale</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/> <t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/>
<tr t-foreach="all_lines" t-as="line"> <tr t-foreach="all_lines" t-as="line">
<td> <td name="line_name">
<span t-field="line.product_id.name"/> <span t-field="line.name"/>
<t t-if="line.name != line.product_id.name"> </td>
<br/><span class="text-muted" t-field="line.name"/> <td>
</t> <span t-field="line.product_id.hs_code"/>
</td> </td>
<td><span t-field="line.product_id.default_code"/></td>
<td><span t-field="line.product_id.hs_code"/></td>
<td> <td>
<span t-field="line.quantity"/> <span t-field="line.quantity"/>
<span t-field="line.product_uom_id" groups="uom.group_uom"/> <span t-field="line.product_uom_id" groups="uom.group_uom"/>
@ -155,31 +171,41 @@
<div class="col-5"> <div class="col-5">
<table class="table table-sm"> <table class="table table-sm">
<tr> <tr>
<td><strong>Packaging / Emballage:</strong></td> <td>
<strong>Packaging / Emballage:</strong>
</td>
<td class="text-right"> <td class="text-right">
<span t-field="o.packaging_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> <span t-field="o.packaging_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><strong>Freight / Fret:</strong></td> <td>
<strong>Freight / Fret:</strong>
</td>
<td class="text-right"> <td class="text-right">
<span t-field="o.freight_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> <span t-field="o.freight_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><strong>Insurance / Assurance:</strong></td> <td>
<strong>Insurance / Assurance:</strong>
</td>
<td class="text-right"> <td class="text-right">
<span t-field="o.insurance_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> <span t-field="o.insurance_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td><strong>Other / Autre:</strong></td> <td>
<strong>Other / Autre:</strong>
</td>
<td class="text-right"> <td class="text-right">
<span t-field="o.other_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> <span t-field="o.other_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td> </td>
</tr> </tr>
<tr class="border-black"> <tr class="border-black">
<td><strong>Total Invoice Value / Valeur totale de la facture:</strong></td> <td>
<strong>Total Invoice Value / Valeur totale de la facture:</strong>
</td>
<td class="text-right"> <td class="text-right">
<strong t-field="o.total_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/> <strong t-field="o.total_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td> </td>
@ -192,23 +218,28 @@
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<tr> <tr>
<td width="33%"> <td width="33%">
<strong>Customs Broker / Courtier en douane:</strong><br/> <strong>Customs Broker / Courtier en douane:</strong>
<br/>
<span t-field="o.customs_broker_id.name"/> <span t-field="o.customs_broker_id.name"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Number of Packages / Nombre de colis:</strong><br/> <strong>Number of Packages / Nombre de colis:</strong>
<br/>
<span t-field="o.number_of_packages"/> <span t-field="o.number_of_packages"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Total Weight / Poids total:</strong><br/> <strong>Total Weight / Poids total:</strong>
<span t-field="o.total_weight"/> kg <br/>
<span t-field="o.total_weight"/>
kg
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td colspan="3">
<strong>Incoterms:</strong> <strong>Incoterms:</strong>
<t t-if="o.incoterm_id"> <t t-if="o.incoterm_id">
<span t-field="o.incoterm_id.code"/> - <span t-field="o.incoterm_id.name"/> <span t-field="o.incoterm_id.code"/>
- <span t-field="o.incoterm_id.name"/>
</t> </t>
</td> </td>
</tr> </tr>