changes
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
domain="[('status','=','shipped')]"/>
|
||||
<filter name="filter_delivered" string="Delivered"
|
||||
domain="[('status','=','delivered')]"/>
|
||||
<filter name="filter_returned" string="Returned"
|
||||
domain="[('status','=','returned')]"/>
|
||||
<filter name="filter_cancelled" string="Cancelled"
|
||||
domain="[('status','=','cancelled')]"/>
|
||||
<group>
|
||||
@@ -45,6 +47,7 @@
|
||||
<field name="sale_order_id" optional="show"/>
|
||||
<field name="picking_id" optional="show"/>
|
||||
<field name="service_type"/>
|
||||
<field name="currency_id" column_invisible="1"/>
|
||||
<field name="shipping_cost" sum="Total Cost"/>
|
||||
<field name="weight" optional="hide"/>
|
||||
<field name="package_name" optional="hide"/>
|
||||
@@ -53,6 +56,7 @@
|
||||
decoration-info="status == 'draft'"
|
||||
decoration-success="status in ('confirmed','shipped')"
|
||||
decoration-bf="status == 'delivered'"
|
||||
decoration-warning="status == 'returned'"
|
||||
decoration-danger="status == 'cancelled'"
|
||||
widget="badge"/>
|
||||
</list>
|
||||
@@ -76,11 +80,17 @@
|
||||
class="btn-secondary"
|
||||
icon="fa-external-link"
|
||||
invisible="not tracking_number"/>
|
||||
<button name="action_create_return_label" type="object"
|
||||
string="Create Return Label"
|
||||
class="btn-warning"
|
||||
icon="fa-mail-reply"
|
||||
invisible="status not in ('delivered', 'shipped') or return_tracking_number"
|
||||
confirm="Return labels are a paid service (bill-on-scan). The cost will be charged to your Canada Post account when the customer uses the label. Continue?"/>
|
||||
<button name="action_void_shipment" type="object"
|
||||
string="Void Shipment"
|
||||
class="btn-danger"
|
||||
icon="fa-ban"
|
||||
invisible="status in ('cancelled', 'delivered')"
|
||||
invisible="status in ('cancelled', 'delivered', 'returned')"
|
||||
confirm="Are you sure you want to void this shipment? This cannot be undone."/>
|
||||
<button name="action_reissue_shipment" type="object"
|
||||
string="Reissue Shipment"
|
||||
@@ -132,6 +142,8 @@
|
||||
<field name="weight"/>
|
||||
<field name="package_name"
|
||||
invisible="not package_name"/>
|
||||
<field name="return_tracking_number"
|
||||
invisible="not return_tracking_number"/>
|
||||
</group>
|
||||
<group string="Links">
|
||||
<field name="sale_order_id"/>
|
||||
@@ -155,6 +167,7 @@
|
||||
<field name="full_label_attachment_id" invisible="1"/>
|
||||
<field name="receipt_attachment_id" invisible="1"/>
|
||||
<field name="commercial_invoice_attachment_id" invisible="1"/>
|
||||
<field name="return_label_attachment_id" invisible="1"/>
|
||||
<group string="Labels">
|
||||
<span class="o_form_label" invisible="not label_attachment_id">Printable Label (4x6)</span>
|
||||
<button name="action_view_label" type="object"
|
||||
@@ -168,6 +181,12 @@
|
||||
icon="fa-file-pdf-o"
|
||||
string="Open"
|
||||
invisible="not full_label_attachment_id"/>
|
||||
<span class="o_form_label" invisible="not return_label_attachment_id">Return Label</span>
|
||||
<button name="action_view_return_label" type="object"
|
||||
class="btn btn-link p-0"
|
||||
icon="fa-file-pdf-o"
|
||||
string="Open"
|
||||
invisible="not return_label_attachment_id"/>
|
||||
</group>
|
||||
<group string="Documents">
|
||||
<span class="o_form_label" invisible="not receipt_attachment_id">Receipt</span>
|
||||
@@ -191,7 +210,7 @@
|
||||
</group>
|
||||
<group>
|
||||
<field name="delivery_date"
|
||||
invisible="status != 'delivered'"/>
|
||||
invisible="status not in ('delivered', 'returned')"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="tracking_event_ids" readonly="1" nolabel="1">
|
||||
@@ -248,9 +267,9 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Window Action -->
|
||||
<!-- Window Actions -->
|
||||
<record id="action_fusion_cp_shipment" model="ir.actions.act_window">
|
||||
<field name="name">Shipments</field>
|
||||
<field name="name">All Shipments</field>
|
||||
<field name="res_model">fusion.cp.shipment</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="search_view_id" ref="view_fusion_cp_shipment_search"/>
|
||||
@@ -263,4 +282,36 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_cp_shipment_confirmed" model="ir.actions.act_window">
|
||||
<field name="name">Confirmed</field>
|
||||
<field name="res_model">fusion.cp.shipment</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="domain">[('status', '=', 'confirmed')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_cp_shipment_search"/>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_cp_shipment_shipped" model="ir.actions.act_window">
|
||||
<field name="name">Shipped</field>
|
||||
<field name="res_model">fusion.cp.shipment</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="domain">[('status', '=', 'shipped')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_cp_shipment_search"/>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_cp_shipment_delivered" model="ir.actions.act_window">
|
||||
<field name="name">Delivered</field>
|
||||
<field name="res_model">fusion.cp.shipment</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="domain">[('status', '=', 'delivered')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_cp_shipment_search"/>
|
||||
</record>
|
||||
|
||||
<record id="action_fusion_cp_shipment_returned" model="ir.actions.act_window">
|
||||
<field name="name">Returned</field>
|
||||
<field name="res_model">fusion.cp.shipment</field>
|
||||
<field name="view_mode">list,form,kanban</field>
|
||||
<field name="domain">[('status', '=', 'returned')]</field>
|
||||
<field name="search_view_id" ref="view_fusion_cp_shipment_search"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
|
||||
@@ -6,13 +6,43 @@
|
||||
web_icon="fusion_canada_post,static/description/icon.png"
|
||||
sequence="85"/>
|
||||
|
||||
<!-- Shipments -->
|
||||
<!-- Shipments (parent — no action) -->
|
||||
<menuitem id="menu_fusion_cp_shipments"
|
||||
name="Shipments"
|
||||
parent="menu_fusion_cp_root"
|
||||
action="action_fusion_cp_shipment"
|
||||
sequence="10"/>
|
||||
|
||||
<!-- Shipments sub-menus -->
|
||||
<menuitem id="menu_fusion_cp_shipments_all"
|
||||
name="All Shipments"
|
||||
parent="menu_fusion_cp_shipments"
|
||||
action="action_fusion_cp_shipment"
|
||||
sequence="1"/>
|
||||
|
||||
<menuitem id="menu_fusion_cp_shipments_confirmed"
|
||||
name="Confirmed"
|
||||
parent="menu_fusion_cp_shipments"
|
||||
action="action_fusion_cp_shipment_confirmed"
|
||||
sequence="10"/>
|
||||
|
||||
<menuitem id="menu_fusion_cp_shipments_shipped"
|
||||
name="Shipped"
|
||||
parent="menu_fusion_cp_shipments"
|
||||
action="action_fusion_cp_shipment_shipped"
|
||||
sequence="20"/>
|
||||
|
||||
<menuitem id="menu_fusion_cp_shipments_delivered"
|
||||
name="Delivered"
|
||||
parent="menu_fusion_cp_shipments"
|
||||
action="action_fusion_cp_shipment_delivered"
|
||||
sequence="30"/>
|
||||
|
||||
<menuitem id="menu_fusion_cp_shipments_returned"
|
||||
name="Returned"
|
||||
parent="menu_fusion_cp_shipments"
|
||||
action="action_fusion_cp_shipment_returned"
|
||||
sequence="40"/>
|
||||
|
||||
<!-- Configuration parent -->
|
||||
<menuitem id="menu_fusion_cp_config"
|
||||
name="Configuration"
|
||||
|
||||
81
fusion_canada_post/views/report_templates.xml
Normal file
81
fusion_canada_post/views/report_templates.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user