Files
Odoo-Modules/fusion_canada_post/views/report_templates.xml
gsinghpal db4b9aa278 changes
2026-03-11 12:15:53 -04:00

82 lines
4.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- ════════════════════════════════════════════════════════
Sale Order PDF — Shipping Information
════════════════════════════════════════════════════════ -->
<template id="report_saleorder_shipping_info"
inherit_id="sale.report_saleorder_document">
<xpath expr="//div[@name='so_total_summary']" position="after">
<t t-set="cp_shipments" t-value="doc.fusion_cp_shipment_ids.filtered(lambda s: s.status != 'cancelled')"/>
<div t-if="cp_shipments" class="mt-4">
<h5><strong>Shipping Information</strong></h5>
<table class="table table-sm table-bordered">
<thead>
<tr>
<th>Tracking Number</th>
<th>Service</th>
<th class="text-end">Weight</th>
<th class="text-end">Cost</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr t-foreach="cp_shipments" t-as="shipment">
<td><span t-field="shipment.tracking_number"/></td>
<td><span t-field="shipment.service_type"/></td>
<td class="text-end">
<span t-field="shipment.weight"/> kg
</td>
<td class="text-end">
<span t-field="shipment.shipping_cost"
t-options="{'widget': 'monetary', 'display_currency': shipment.currency_id}"/>
</td>
<td><span t-field="shipment.status"/></td>
</tr>
</tbody>
</table>
</div>
</xpath>
</template>
<!-- ════════════════════════════════════════════════════════
Invoice PDF — Shipping Information
════════════════════════════════════════════════════════ -->
<template id="report_invoice_shipping_info"
inherit_id="account.report_invoice_document">
<xpath expr="//div[@id='payment_term']" position="before">
<t t-set="sale_orders" t-value="o.line_ids.sale_line_ids.order_id"/>
<t t-set="cp_shipments" t-value="sale_orders.mapped('fusion_cp_shipment_ids').filtered(lambda s: s.status != 'cancelled')" t-if="sale_orders"/>
<div t-if="cp_shipments" class="mt-4">
<h5><strong>Shipping Information</strong></h5>
<table class="table table-sm table-bordered">
<thead>
<tr>
<th>Tracking Number</th>
<th>Service</th>
<th class="text-end">Weight</th>
<th class="text-end">Cost</th>
<th>Status</th>
</tr>
</thead>
<tbody>
<tr t-foreach="cp_shipments" t-as="shipment">
<td><span t-field="shipment.tracking_number"/></td>
<td><span t-field="shipment.service_type"/></td>
<td class="text-end">
<span t-field="shipment.weight"/> kg
</td>
<td class="text-end">
<span t-field="shipment.shipping_cost"
t-options="{'widget': 'monetary', 'display_currency': shipment.currency_id}"/>
</td>
<td><span t-field="shipment.status"/></td>
</tr>
</tbody>
</table>
</div>
</xpath>
</template>
</odoo>