feat: separate fusion field service and LTC into standalone modules, update core modules

- fusion_claims: separated field service logic, updated controllers/views
- fusion_tasks: updated task views and map integration
- fusion_authorizer_portal: added page 11 signing, schedule booking, migrations
- fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator)
- fusion_ltc_management: new standalone LTC management module
This commit is contained in:
2026-03-11 16:19:52 +00:00
parent 1f79cdcaaf
commit 431052920e
274 changed files with 52782 additions and 7302 deletions

View File

@@ -0,0 +1,89 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="choose_delivery_carrier_view_form_fusion" model="ir.ui.view">
<field name="name">choose.delivery.carrier.form.fusion</field>
<field name="model">choose.delivery.carrier</field>
<field name="inherit_id" ref="delivery.choose_delivery_carrier_view_form"/>
<field name="arch" type="xml">
<!-- Hidden state fields -->
<xpath expr="//field[@name='delivery_price']" position="after">
<field name="fusion_selected_service" invisible="1"/>
<field name="fusion_dimension_unit_label" invisible="1"/>
<field name="fusion_weight_unit_label" invisible="1"/>
</xpath>
<!-- Hide base "Get rate" button for Fusion shipping carriers -->
<xpath expr="//button[@name='update_price']" position="attributes">
<attribute name="invisible">delivery_type in ('fixed', 'base_on_rule', 'fusion_canada_post')</attribute>
</xpath>
<!-- "Get Prices" button (inside the Cost / Get-rate row) -->
<xpath expr="//button[@name='update_price']" position="after">
<button name="update_price" type="object"
invisible="delivery_type != 'fusion_canada_post'">
<i class="oi oi-arrow-right me-1"/>Get Prices
</button>
</xpath>
<!--
Full-width sections AFTER the outer <group>.
This avoids them being crammed into the group's
label-field grid and gives them the full dialog width.
-->
<xpath expr="//form/group" position="after">
<!-- Package list -->
<div invisible="delivery_type != 'fusion_canada_post'"
class="px-3 mt-2">
<span class="o_form_label fw-bold mb-1">Packages</span>
<field name="fusion_package_ids" nolabel="1">
<list editable="bottom">
<field name="sequence" widget="handle"/>
<field name="package_type_id" string="Box Type"/>
<field name="package_length" string="L"/>
<field name="package_width" string="W"/>
<field name="package_height" string="H"/>
<field name="weight" string="Weight"/>
<field name="selected_price" string="Cost"
widget="monetary"
options="{'currency_field': 'currency_id'}"
optional="hide"/>
<field name="currency_id" column_invisible="1"/>
</list>
</field>
</div>
<!-- Service selection -->
<div invisible="delivery_type != 'fusion_canada_post' or not fusion_rate_ids"
class="px-3 mt-3">
<span class="o_form_label fw-bold mb-1">Select a Service</span>
<field name="fusion_rate_ids" nolabel="1">
<list create="0" delete="0" no_open="1"
decoration-bf="is_selected"
decoration-success="is_selected">
<field name="is_selected" column_invisible="1"/>
<field name="service_name" string="Service"/>
<field name="price" string="Shipping Cost"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" column_invisible="1"/>
<field name="expected_delivery"
string="Expected Delivery"/>
<button name="action_select" type="object"
string="Select"
class="btn-sm btn-link"
icon="fa-circle-o"
invisible="is_selected"/>
<button name="action_select" type="object"
string="Selected"
class="btn-sm btn-primary"
icon="fa-check-circle"
invisible="not is_selected"/>
</list>
</field>
</div>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,351 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="delivery_carrier_form_view_fusion_shipping" model="ir.ui.view">
<field name="name">delivery.carrier.form.view.fusion.shipping</field>
<field name="model">delivery.carrier</field>
<field name="inherit_id" ref="delivery.view_delivery_carrier_form"/>
<field name="arch" type="xml">
<!-- ================================================================
Integration Level: custom label for Fusion carriers
================================================================ -->
<xpath expr="//field[@name='integration_level']" position="attributes">
<attribute name="invisible">delivery_type in ('fusion_canada_post', 'fusion_ups', 'fusion_ups_rest', 'fusion_fedex', 'fusion_fedex_rest', 'fusion_dhl', 'fusion_dhl_rest')</attribute>
</xpath>
<xpath expr="//field[@name='integration_level']" position="after">
<field name="integration_level"
invisible="delivery_type not in ('fusion_canada_post', 'fusion_ups', 'fusion_ups_rest', 'fusion_fedex', 'fusion_fedex_rest', 'fusion_dhl', 'fusion_dhl_rest')"
widget="radio"
options="{'horizontal': true}"
help="Get Prices: only fetch shipping prices on sale orders. Get Prices and Create Shipment: also generate labels and tracking when the delivery order is validated."/>
</xpath>
<xpath expr="//page[@name='destination']" position="before">
<!-- ════════════════════════════════════════════════════
CANADA POST Configuration
════════════════════════════════════════════════════ -->
<page string="Canada Post Configuration" name="fusion_cp_configuration"
invisible="delivery_type != 'fusion_canada_post'">
<group string="API Credentials"
invisible="delivery_type != 'fusion_canada_post'">
<group>
<field name="username" string="API Key"
required="delivery_type == 'fusion_canada_post'"
help="API key from the Canada Post Developer Program."/>
<field name="password" string="API Password" password="True"
required="delivery_type == 'fusion_canada_post'"
help="API password from the Canada Post Developer Program."/>
<field name="customer_number" required="delivery_type == 'fusion_canada_post'"
help="Your Canada Post customer number (mailed-by number)."/>
</group>
<group>
<field name="fusion_cp_type" string="Account Type"
required="delivery_type == 'fusion_canada_post'"/>
<field name="fusion_cp_contract_id" required="fusion_cp_type == 'commercial'"
invisible="fusion_cp_type == 'counter'"/>
</group>
</group>
<group>
<group string="Shipping Options">
<field name="service_type" string="Default Service"
required="delivery_type == 'fusion_canada_post'"
help="Default shipping service. Users can choose a different service when adding shipping to a sale order."/>
<field name="option_code" string="Shipping Option"/>
<field name="reason_for_export"/>
<field name="product_packaging_id"
help="Optional default package type. Dimensions will pre-fill in the shipping wizard but can be overridden per shipment."/>
<field name="fusion_cp_dimension_unit"
required="delivery_type == 'fusion_canada_post'"
help="Unit for package dimensions. Values are automatically converted to centimetres for the Canada Post API."/>
</group>
<group string="Payment &amp; Tracking">
<field name="fusion_cp_payment_method"
string="Payment Method"
required="delivery_type == 'fusion_canada_post'"/>
<field name="tracking_link"
help="Custom tracking URL. Leave blank to use the default Canada Post tracking page."/>
</group>
</group>
<group string="Label Settings"
invisible="delivery_type != 'fusion_canada_post'">
<group>
<field name="fusion_cp_output_format"
required="delivery_type == 'fusion_canada_post'"/>
</group>
</group>
</page>
<!-- ════════════════════════════════════════════════════
UPS REST Configuration
════════════════════════════════════════════════════ -->
<page string="UPS REST Configuration" name="fusion_ups_rest_configuration"
invisible="delivery_type != 'fusion_ups_rest'">
<group>
<group>
<field name="ups_shipper_number" required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_client_id" required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_client_secret" required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_default_service_type" required="delivery_type == 'fusion_ups_rest'"/>
</group>
<group>
<field name="ups_default_packaging_id" required="delivery_type == 'fusion_ups_rest'"
domain="[('package_carrier_type', '=', 'fusion_ups_rest')]"/>
<field name="ups_package_weight_unit" string="Package Weight Unit"
required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_package_dimension_unit"
required="delivery_type == 'fusion_ups_rest'"/>
<field name="ups_label_file_type" string="Label Format"
required="delivery_type == 'fusion_ups_rest'"/>
</group>
<group string="Options" name="ups_rest_vas" colspan="2">
<group>
<field name="ups_bill_my_account"
invisible="delivery_type != 'fusion_ups_rest'"/>
<field name="ups_saturday_delivery" string="Saturday Delivery"
required="delivery_type == 'fusion_ups_rest'"
invisible="ups_default_service_type in ['03','11','13','59','12','65','08']"/>
<field name="allow_cash_on_delivery"
required="delivery_type == 'fusion_ups_rest'"
invisible="ups_default_service_type == '96'"
help="This value added service enables UPS to collect the payment of the shipment from your customer."/>
<field name="ups_cod_funds_code"
required="delivery_type == 'fusion_ups_rest'"
invisible="not allow_cash_on_delivery" widget="radio"/>
<field name="can_generate_return" invisible="1"/>
<field name="return_label_on_delivery" invisible="not can_generate_return"/>
<field name="get_return_label_from_portal" invisible="not return_label_on_delivery"/>
</group>
<group>
<field name="ups_require_signature"/>
<field name="ups_duty_payment" string="Duties paid by"
required="delivery_type == 'fusion_ups_rest'"/>
</group>
</group>
</group>
</page>
<!-- ════════════════════════════════════════════════════
UPS Legacy Configuration
════════════════════════════════════════════════════ -->
<page string="UPS Configuration" name="fusion_ups_configuration"
invisible="delivery_type != 'fusion_ups'">
<group>
<group>
<field name="ups_username" required="delivery_type == 'fusion_ups'"/>
<field name="ups_passwd" required="delivery_type == 'fusion_ups'"/>
<field name="ups_shipper_number" required="delivery_type == 'fusion_ups'"/>
<field name="ups_access_number" required="delivery_type == 'fusion_ups'"/>
<field name="ups_default_service_type" required="delivery_type == 'fusion_ups'"/>
</group>
<group>
<field name="ups_default_package_type_id" required="delivery_type == 'fusion_ups'"
domain="[('package_carrier_type', '=', 'fusion_ups')]"/>
<field name="ups_package_weight_unit" string="Package Weight Unit"
required="delivery_type == 'fusion_ups'"/>
<field name="ups_package_dimension_unit"
required="delivery_type == 'fusion_ups'"/>
<field name="ups_label_file_type" string="Label Format"
required="delivery_type == 'fusion_ups'"/>
</group>
<group string="Options" name="ups_legacy_vas">
<field name="ups_bill_my_account" invisible="delivery_type != 'fusion_ups'"/>
<field name="ups_saturday_delivery" string="Saturday Delivery"
invisible="ups_default_service_type in ['03', '11', '13', '59', '12', '65', '08']"
required="delivery_type == 'fusion_ups'"/>
<field name="allow_cash_on_delivery"
required="delivery_type == 'fusion_ups'"
invisible="ups_default_service_type == '96'"
help="This value added service enables UPS to collect the payment of the shipment from your customer."/>
<field name="ups_cod_funds_code" invisible="not allow_cash_on_delivery"
required="delivery_type == 'fusion_ups'" widget="radio"/>
<field name="can_generate_return" invisible="1"/>
<field name="return_label_on_delivery" invisible="not can_generate_return"/>
<field name="get_return_label_from_portal" invisible="not return_label_on_delivery"/>
<field name="ups_duty_payment" string="Duties paid by"
required="delivery_type == 'fusion_ups'"/>
</group>
</group>
</page>
<!-- ════════════════════════════════════════════════════
FedEx REST Configuration
════════════════════════════════════════════════════ -->
<page string="FedEx REST Configuration" name="fusion_fedex_rest_configuration"
invisible="delivery_type != 'fusion_fedex_rest'">
<group>
<group>
<field name="fedex_rest_developer_key" required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_developer_password" required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_account_number" string="Account Number"
required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_service_type" required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_droppoff_type" required="delivery_type == 'fusion_fedex_rest'"/>
</group>
<group>
<field name="fedex_rest_default_package_type_id"
required="delivery_type == 'fusion_fedex_rest'"
domain="[('package_carrier_type', '=', 'fusion_fedex_rest')]"/>
<field name="fedex_rest_weight_unit" string="Package Weight Unit"
required="delivery_type == 'fusion_fedex_rest'"/>
<div class="o_td_label">
<span class="o_form_label">Package Length Unit</span>
</div>
<div class="o_field_widget">
<span invisible="fedex_rest_weight_unit != 'KG'">Centimeters</span>
<span invisible="fedex_rest_weight_unit != 'LB'">Inches</span>
</div>
<field name="fedex_rest_label_stock_type" required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_label_file_type" string="Label Format"
required="delivery_type == 'fusion_fedex_rest'"/>
</group>
<group string="Options">
<field name="return_label_on_delivery" invisible="not can_generate_return"/>
<field name="get_return_label_from_portal" invisible="not return_label_on_delivery"/>
<field name="fedex_rest_email_notifications"/>
<field name="fedex_rest_duty_payment" string="Duties paid by"
required="delivery_type == 'fusion_fedex_rest'"/>
<field name="fedex_rest_residential_address"/>
<field name="fedex_rest_documentation_type"/>
<field name="fedex_rest_override_shipper_vat"/>
</group>
<group string="Extra Data" name="fedex_rest_extra_data" groups="base.group_no_one">
<field name="fedex_rest_extra_data_rate_request"/>
<field name="fedex_rest_extra_data_ship_request"/>
<field name="fedex_rest_extra_data_return_request"/>
</group>
</group>
</page>
<!-- ════════════════════════════════════════════════════
FedEx Legacy Configuration
════════════════════════════════════════════════════ -->
<page string="FedEx Configuration" name="fusion_fedex_configuration"
invisible="delivery_type != 'fusion_fedex'">
<group>
<group>
<field name="fedex_developer_key" required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_developer_password" required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_account_number" string="Account Number"
required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_meter_number" required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_service_type" required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_droppoff_type" required="delivery_type == 'fusion_fedex'"/>
</group>
<group>
<field name="fedex_default_package_type_id"
required="delivery_type == 'fusion_fedex'"
domain="[('package_carrier_type', '=', 'fusion_fedex')]"/>
<field name="fedex_weight_unit" string="Package Weight Unit"
required="delivery_type == 'fusion_fedex'"/>
<div class="o_td_label">
<span class="o_form_label">Package Length Unit</span>
</div>
<div class="o_field_widget">
<span invisible="fedex_weight_unit != 'KG'">CM</span>
<span invisible="fedex_weight_unit != 'LB'">IN</span>
</div>
<field name="fedex_label_stock_type" required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_label_file_type" string="Label Format"
required="delivery_type == 'fusion_fedex'"/>
<field name="fedex_document_stock_type" required="delivery_type == 'fusion_fedex'"/>
</group>
<group string="Options">
<field name="fedex_saturday_delivery" string="Saturday Delivery"
invisible="fedex_service_type not in ['INTERNATIONAL_PRIORITY', 'FEDEX_2_DAY', 'FIRST_OVERNIGHT', 'PRIORITY_OVERNIGHT']"
required="delivery_type == 'fusion_fedex'"/>
<field name="can_generate_return" invisible="1"/>
<field name="return_label_on_delivery" invisible="not can_generate_return"/>
<field name="get_return_label_from_portal" invisible="not return_label_on_delivery"/>
<field name="fedex_duty_payment" string="Duties paid by"
required="delivery_type == 'fusion_fedex'"/>
</group>
<group string="Extra Data" name="fedex_legacy_extra_data" groups="base.group_no_one">
<field name="fedex_extra_data_rate_request"/>
<field name="fedex_extra_data_ship_request"/>
<field name="fedex_extra_data_return_request"/>
</group>
</group>
</page>
<!-- ════════════════════════════════════════════════════
DHL REST Configuration
════════════════════════════════════════════════════ -->
<page string="DHL REST Configuration" name="fusion_dhl_rest_configuration"
invisible="delivery_type != 'fusion_dhl_rest'">
<group>
<group>
<field name="dhl_api_key" required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_api_secret" required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_account_number" required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_region_code" required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_product_code" required="delivery_type == 'fusion_dhl_rest'"/>
</group>
<group>
<field name="dhl_default_package_type_id"
required="delivery_type == 'fusion_dhl_rest'"
domain="[('package_carrier_type', '=', 'fusion_dhl_rest')]"/>
<field name="dhl_unit_system" required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_label_image_format" string="Label Format"
required="delivery_type == 'fusion_dhl_rest'"/>
<field name="dhl_label_template" required="delivery_type == 'fusion_dhl_rest'"/>
</group>
<group string="Options">
<field name="return_label_on_delivery" invisible="can_generate_return == False"/>
<field name="get_return_label_from_portal" invisible="return_label_on_delivery == False"/>
<field name="dhl_dutiable"/>
<field name="dhl_duty_payment" string="Duties paid by"
invisible="dhl_dutiable == False"
required="delivery_type == 'fusion_dhl_rest'"/>
</group>
</group>
<group string="Custom Data" name="dhl_rest_customs" groups="base.group_no_one">
<field name="dhl_extra_data_rate_request" colspan="2"/>
<field name="dhl_extra_data_ship_request" colspan="2"/>
<field name="dhl_extra_data_return_request" colspan="2"/>
</group>
</page>
<!-- ════════════════════════════════════════════════════
DHL Legacy Configuration
════════════════════════════════════════════════════ -->
<page string="DHL Configuration" name="fusion_dhl_configuration"
invisible="delivery_type != 'fusion_dhl'">
<group>
<group>
<field name="dhl_SiteID" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_password" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_account_number" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_region_code" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_product_code" required="delivery_type == 'fusion_dhl'"/>
</group>
<group>
<field name="dhl_default_package_type_id"
required="delivery_type == 'fusion_dhl'"
domain="[('package_carrier_type', '=', 'fusion_dhl')]"/>
<field name="dhl_package_weight_unit" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_package_dimension_unit" required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_label_image_format" string="Label Format"
required="delivery_type == 'fusion_dhl'"/>
<field name="dhl_label_template" required="delivery_type == 'fusion_dhl'"/>
</group>
<group string="Options">
<field name="can_generate_return" invisible="1"/>
<field name="return_label_on_delivery" invisible="not can_generate_return"/>
<field name="get_return_label_from_portal" invisible="not return_label_on_delivery"/>
<field name="dhl_dutiable"/>
<field name="dhl_duty_payment" string="Duties paid by"
invisible="not dhl_dutiable"
required="delivery_type == 'fusion_dhl'"/>
</group>
<group string="Custom Data" name="dhl_legacy_customs" groups="base.group_no_one">
<field name="dhl_custom_data_request" nolabel="1"
placeholder="'rate': {}, 'ship': {}, 'return': {}"/>
</group>
</group>
</page>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,323 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Search View -->
<record id="view_fusion_shipment_search" model="ir.ui.view">
<field name="name">fusion.shipment.search</field>
<field name="model">fusion.shipment</field>
<field name="arch" type="xml">
<search string="Search Shipments">
<field name="name"/>
<field name="tracking_number"/>
<field name="shipment_id"/>
<field name="sale_order_id"/>
<field name="picking_id"/>
<field name="recipient_name"/>
<field name="carrier_type"/>
<filter name="filter_confirmed" string="Confirmed"
domain="[('status','=','confirmed')]"/>
<filter name="filter_shipped" string="Shipped"
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>
<filter name="group_status" string="Status"
context="{'group_by': 'status'}"/>
<filter name="group_service" string="Service Type"
context="{'group_by': 'service_type'}"/>
<filter name="group_carrier_type" string="Carrier Type"
context="{'group_by': 'carrier_type'}"/>
<filter name="group_date" string="Shipment Date"
context="{'group_by': 'shipment_date:month'}"/>
</group>
</search>
</field>
</record>
<!-- List View -->
<record id="view_fusion_shipment_list" model="ir.ui.view">
<field name="name">fusion.shipment.list</field>
<field name="model">fusion.shipment</field>
<field name="arch" type="xml">
<list string="Shipments" default_order="shipment_date desc">
<field name="name" decoration-bf="1"/>
<field name="tracking_number"/>
<field name="recipient_name"/>
<field name="sale_order_id" optional="show"/>
<field name="picking_id" optional="show"/>
<field name="carrier_type" 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"/>
<field name="shipment_date"/>
<field name="status"
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>
</field>
</record>
<!-- Form View -->
<record id="view_fusion_shipment_form" model="ir.ui.view">
<field name="name">fusion.shipment.form</field>
<field name="model">fusion.shipment</field>
<field name="arch" type="xml">
<form string="Shipment">
<header>
<button name="action_refresh_tracking" type="object"
string="Refresh Tracking"
class="btn-primary"
icon="fa-refresh"
invisible="not tracking_number or status == 'cancelled'"/>
<button name="action_track_on_carrier" type="object"
string="Track Shipment"
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 may incur additional charges. Continue?"/>
<button name="action_void_shipment" type="object"
string="Void Shipment"
class="btn-danger"
icon="fa-ban"
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"
class="btn-warning"
icon="fa-repeat"
invisible="status != 'cancelled'"/>
<field name="status" widget="statusbar"
statusbar_visible="confirmed,shipped,delivered"/>
</header>
<sheet>
<div name="button_box" class="oe_button_box">
<button name="action_open_sale_order" type="object"
class="oe_stat_button" icon="fa-shopping-cart"
invisible="not sale_order_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Sale Order</span>
</div>
</button>
<button name="action_open_picking" type="object"
class="oe_stat_button" icon="fa-truck"
invisible="not picking_id">
<div class="o_field_widget o_stat_info">
<span class="o_stat_text">Transfer</span>
</div>
</button>
<button name="action_refresh_tracking" type="object"
class="oe_stat_button" icon="fa-map-marker"
invisible="not tracking_number">
<div class="o_field_widget o_stat_info">
<span class="o_stat_value">
<field name="tracking_event_count"/>
</span>
<span class="o_stat_text">Events</span>
</div>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" readonly="1"/></h1>
</div>
<group>
<group string="Shipment Details">
<field name="tracking_number"/>
<field name="shipment_id"/>
<field name="carrier_id"/>
<field name="carrier_type"/>
<field name="service_type"/>
<field name="shipment_date"/>
<field name="shipping_cost"/>
<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"/>
<field name="picking_id"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
<group>
<group string="Sender">
<field name="sender_name"/>
<field name="sender_address"/>
</group>
<group string="Recipient">
<field name="recipient_name"/>
<field name="recipient_address"/>
</group>
</group>
<notebook>
<page string="Labels &amp; Documents" name="labels">
<field name="label_attachment_id" invisible="1"/>
<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"
class="btn btn-link p-0"
icon="fa-file-pdf-o"
string="Open"
invisible="not label_attachment_id"/>
<span class="o_form_label" invisible="not full_label_attachment_id">Full Label (8.5x11)</span>
<button name="action_view_full_label" type="object"
class="btn btn-link p-0"
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>
<button name="action_view_receipt" type="object"
class="btn btn-link p-0"
icon="fa-file-pdf-o"
string="Open"
invisible="not receipt_attachment_id"/>
<span class="o_form_label" invisible="not commercial_invoice_attachment_id">Commercial Invoice</span>
<button name="action_view_commercial_invoice" type="object"
class="btn btn-link p-0"
icon="fa-file-pdf-o"
string="Open"
invisible="not commercial_invoice_attachment_id"/>
</group>
</page>
<page string="Tracking History" name="tracking_history">
<group>
<group>
<field name="last_tracking_update"/>
</group>
<group>
<field name="delivery_date"
invisible="status not in ('delivered', 'returned')"/>
</group>
</group>
<field name="tracking_event_ids" readonly="1" nolabel="1">
<list string="Tracking Events"
default_order="event_datetime desc">
<field name="event_datetime" string="Date/Time"/>
<field name="event_description"/>
<field name="event_site" string="Location"/>
<field name="event_province"/>
<field name="signatory_name" optional="hide"/>
<field name="event_type" optional="hide"/>
</list>
</field>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<!-- Kanban View -->
<record id="view_fusion_shipment_kanban" model="ir.ui.view">
<field name="name">fusion.shipment.kanban</field>
<field name="model">fusion.shipment</field>
<field name="arch" type="xml">
<kanban default_group_by="status" class="o_kanban_small_column">
<field name="name"/>
<field name="tracking_number"/>
<field name="status"/>
<field name="shipping_cost"/>
<field name="shipment_date"/>
<field name="recipient_name"/>
<field name="service_type"/>
<field name="carrier_type"/>
<templates>
<t t-name="card">
<div class="oe_kanban_details">
<strong><field name="name"/></strong>
<div><field name="recipient_name"/></div>
<div class="text-muted">
<i class="fa fa-barcode"/> <field name="tracking_number"/>
</div>
<div class="text-muted">
<field name="service_type"/> |
<field name="shipment_date" widget="date"/>
</div>
<div>
<strong>$<field name="shipping_cost"/></strong>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<!-- Window Actions -->
<record id="action_fusion_shipment" model="ir.actions.act_window">
<field name="name">All Shipments</field>
<field name="res_model">fusion.shipment</field>
<field name="view_mode">list,form,kanban</field>
<field name="search_view_id" ref="view_fusion_shipment_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No shipments yet
</p>
<p>Shipments are created automatically when you validate a delivery
order with a shipping carrier.</p>
</field>
</record>
<record id="action_fusion_shipment_confirmed" model="ir.actions.act_window">
<field name="name">Confirmed</field>
<field name="res_model">fusion.shipment</field>
<field name="view_mode">list,form,kanban</field>
<field name="domain">[('status', '=', 'confirmed')]</field>
<field name="search_view_id" ref="view_fusion_shipment_search"/>
</record>
<record id="action_fusion_shipment_shipped" model="ir.actions.act_window">
<field name="name">Shipped</field>
<field name="res_model">fusion.shipment</field>
<field name="view_mode">list,form,kanban</field>
<field name="domain">[('status', '=', 'shipped')]</field>
<field name="search_view_id" ref="view_fusion_shipment_search"/>
</record>
<record id="action_fusion_shipment_delivered" model="ir.actions.act_window">
<field name="name">Delivered</field>
<field name="res_model">fusion.shipment</field>
<field name="view_mode">list,form,kanban</field>
<field name="domain">[('status', '=', 'delivered')]</field>
<field name="search_view_id" ref="view_fusion_shipment_search"/>
</record>
<record id="action_fusion_shipment_returned" model="ir.actions.act_window">
<field name="name">Returned</field>
<field name="res_model">fusion.shipment</field>
<field name="view_mode">list,form,kanban</field>
<field name="domain">[('status', '=', 'returned')]</field>
<field name="search_view_id" ref="view_fusion_shipment_search"/>
</record>
</odoo>

View File

@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Top-level app menu -->
<menuitem id="menu_fusion_shipping_root"
name="Shipping"
web_icon="fusion_shipping,static/description/icon.png"
sequence="85"/>
<!-- Shipments parent -->
<menuitem id="menu_fusion_shipments"
name="Shipments"
parent="menu_fusion_shipping_root"
sequence="10"/>
<!-- Shipments sub-menus -->
<menuitem id="menu_fusion_shipments_all"
name="All Shipments"
parent="menu_fusion_shipments"
action="action_fusion_shipment"
sequence="1"/>
<menuitem id="menu_fusion_shipments_confirmed"
name="Confirmed"
parent="menu_fusion_shipments"
action="action_fusion_shipment_confirmed"
sequence="10"/>
<menuitem id="menu_fusion_shipments_shipped"
name="Shipped"
parent="menu_fusion_shipments"
action="action_fusion_shipment_shipped"
sequence="20"/>
<menuitem id="menu_fusion_shipments_delivered"
name="Delivered"
parent="menu_fusion_shipments"
action="action_fusion_shipment_delivered"
sequence="30"/>
<menuitem id="menu_fusion_shipments_returned"
name="Returned"
parent="menu_fusion_shipments"
action="action_fusion_shipment_returned"
sequence="40"/>
<!-- Configuration parent -->
<menuitem id="menu_fusion_config"
name="Configuration"
parent="menu_fusion_shipping_root"
sequence="90"/>
<!-- Carrier Settings action -->
<record id="action_fusion_carrier_settings" model="ir.actions.act_window">
<field name="name">Shipping Carriers</field>
<field name="res_model">delivery.carrier</field>
<field name="view_mode">list,form</field>
<field name="domain">[('delivery_type', 'like', 'fusion_')]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Configure your shipping carriers
</p>
</field>
</record>
<menuitem id="menu_fusion_carrier"
name="Carriers"
parent="menu_fusion_config"
action="action_fusion_carrier_settings"
sequence="10"/>
</odoo>

View File

@@ -0,0 +1,77 @@
<?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="shipments" t-value="doc.fusion_shipment_ids.filtered(lambda s: s.status != 'cancelled')"/>
<div t-if="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="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="shipments" t-value="sale_orders.mapped('fusion_shipment_ids').filtered(lambda s: s.status != 'cancelled')" t-if="sale_orders"/>
<div t-if="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="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>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form_fusion_shipping" model="ir.ui.view">
<field name="name">res.config.settings.view.form.fusion.shipping</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<app data-string="Shipping" string="Shipping"
name="fusion_shipping">
<block title="Carrier Configuration" name="carrier_config_block">
<setting string="Shipping Carrier Settings"
help="Configure your shipping API credentials, service types, label format, and shipping preferences.">
<div class="content-group">
<div class="mt8">
<button name="%(fusion_shipping.action_fusion_carrier_settings)d"
type="action"
class="btn-link"
icon="oi-arrow-right"
string="Open Carrier Configuration"/>
</div>
</div>
</setting>
<setting string="Shipment History"
help="View and manage all shipments, labels, and tracking information.">
<div class="content-group">
<div class="mt8">
<button name="%(fusion_shipping.action_fusion_shipment)d"
type="action"
class="btn-link"
icon="oi-arrow-right"
string="View Shipments"/>
</div>
</div>
</setting>
</block>
</app>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_partner_form_inherit_fusion_shipping" model="ir.ui.view">
<field name="name">res.partner.form.inherit.fusion.shipping</field>
<field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<xpath expr="//page[@name='sales_purchases']//group[@name='sale']" position="inside">
<field name="property_ups_carrier_account"
string="UPS Account Number"
help="If set, this customer can have UPS shipping charged to their own account."/>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,49 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_order_form_fusion_shipping" model="ir.ui.view">
<field name="name">sale.order.form.fusion.shipping</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_fusion_shipments" type="object"
class="oe_stat_button" icon="fa-plane"
invisible="fusion_shipment_count == 0">
<field name="fusion_shipment_count" widget="statinfo"
string="Shipments"/>
</button>
</xpath>
<!-- UPS Bill My Account fields -->
<xpath expr="//field[@name='partner_shipping_id']" position="after">
<field name="ups_bill_my_account" invisible="1"/>
<field name="partner_ups_carrier_account"
invisible="not ups_bill_my_account"/>
</xpath>
<!-- Show package details on the sale order -->
<xpath expr="//group[@name='note_group']" position="before">
<group string="Shipping Packages"
invisible="not fusion_package_ids"
colspan="6">
<field name="fusion_package_ids" nolabel="1"
colspan="6" readonly="1">
<list create="0" delete="0" no_open="1">
<field name="package_type_id" string="Box Type"
optional="show"/>
<field name="package_length" string="Length"/>
<field name="package_width" string="Width"/>
<field name="package_height" string="Height"/>
<field name="weight" string="Weight"/>
<field name="service_name" string="Service"/>
<field name="price" string="Cost"
widget="monetary"
options="{'currency_field': 'currency_id'}"/>
<field name="currency_id" column_invisible="1"/>
</list>
</field>
</group>
</xpath>
</field>
</record>
</odoo>

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_picking_form_fusion_shipping" model="ir.ui.view">
<field name="name">stock.picking.form.fusion.shipping</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock.view_picking_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='button_box']" position="inside">
<button name="action_view_fusion_shipments" type="object"
class="oe_stat_button" icon="fa-plane"
invisible="fusion_shipment_count == 0">
<field name="fusion_shipment_count" widget="statinfo"
string="Shipments"/>
</button>
</xpath>
</field>
</record>
</odoo>