Files
Odoo-Modules/fusion_plating/fusion_plating_logistics/views/fp_delivery_views.xml
gsinghpal 091f98e1f9 changes
2026-05-18 22:33:23 -04:00

213 lines
11 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Plating product family.
-->
<odoo>
<record id="view_fp_delivery_list" model="ir.ui.view">
<field name="name">fp.delivery.list</field>
<field name="model">fusion.plating.delivery</field>
<field name="arch" type="xml">
<list string="Deliveries"
decoration-muted="state in ('cancelled','returned')"
decoration-danger="state == 'refused'"
decoration-success="state == 'delivered'">
<field name="name"/>
<field name="partner_id"/>
<field name="job_ref"/>
<field name="scheduled_date"/>
<field name="assigned_driver_id"/>
<field name="vehicle_id"/>
<field name="source_facility_id"/>
<field name="tdg_required" widget="boolean_toggle" optional="show"/>
<field name="state" widget="badge"
decoration-info="state == 'draft'"
decoration-warning="state == 'scheduled'"
decoration-primary="state == 'en_route'"
decoration-success="state == 'delivered'"
decoration-danger="state == 'refused'"
decoration-muted="state in ('returned','cancelled')"/>
</list>
</field>
</record>
<record id="view_fp_delivery_form" model="ir.ui.view">
<field name="name">fp.delivery.form</field>
<field name="model">fusion.plating.delivery</field>
<field name="arch" type="xml">
<form string="Delivery">
<header>
<button name="action_schedule" string="Schedule" type="object"
class="oe_highlight" invisible="state != 'draft'"/>
<button name="action_start_route" string="Start Route" type="object"
invisible="state != 'scheduled'"/>
<button name="action_mark_delivered" string="Mark Delivered" type="object"
class="oe_highlight" invisible="state != 'en_route'"/>
<button name="action_create_pod" string="Create POD" type="object"
invisible="state not in ('en_route','delivered') or pod_id"/>
<button name="action_mark_refused" string="Refused" type="object"
invisible="state != 'en_route'"/>
<button name="action_mark_returned" string="Returned" type="object"
invisible="state not in ('refused','en_route')"/>
<button name="action_cancel" string="Cancel" type="object"
invisible="state in ('delivered','cancelled')"/>
<button name="action_reset_to_draft" string="Reset to Draft" type="object"
invisible="state != 'cancelled'"/>
<field name="state" widget="statusbar"
statusbar_visible="draft,scheduled,en_route,delivered"/>
</header>
<sheet>
<div class="oe_button_box" name="button_box">
<button name="action_create_outbound_shipment"
type="object"
class="oe_stat_button"
icon="fa-truck">
<field name="x_fc_outbound_shipment_count"
widget="statinfo"
string="Outbound Shipment"/>
</button>
</div>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" readonly="1"/></h1>
</div>
<group>
<group string="Customer">
<field name="partner_id"/>
<field name="delivery_address_id"/>
<field name="contact_name"/>
<field name="contact_phone" widget="phone"/>
<field name="job_ref"/>
</group>
<group string="Schedule">
<field name="scheduled_date"/>
<field name="source_facility_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="delivered_at" readonly="1"/>
</group>
</group>
<group>
<group string="Assignment">
<field name="assigned_driver_id"/>
<field name="vehicle_id"/>
<field name="tdg_required" widget="boolean_toggle"/>
</group>
<group string="Outbound Shipping">
<field name="x_fc_carrier_id"
options="{'no_create': True}"/>
<field name="coc_attachment_id"/>
<field name="packing_list_attachment_id"/>
<field name="pod_id" readonly="1"/>
</group>
</group>
<notebook>
<page string="Notes">
<field name="notes"/>
</page>
<page string="Chain of Custody">
<field name="custody_event_ids" readonly="1">
<list>
<field name="event_datetime"/>
<field name="event_type"/>
<field name="from_party"/>
<field name="to_party"/>
<field name="recorded_by_id"/>
</list>
</field>
</page>
</notebook>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_fp_delivery_kanban" model="ir.ui.view">
<field name="name">fp.delivery.kanban</field>
<field name="model">fusion.plating.delivery</field>
<field name="arch" type="xml">
<kanban default_group_by="state" class="o_fp_delivery_kanban">
<field name="id"/>
<field name="name"/>
<field name="partner_id"/>
<field name="scheduled_date"/>
<field name="assigned_driver_id"/>
<field name="vehicle_id"/>
<field name="tdg_required"/>
<field name="job_ref"/>
<templates>
<t t-name="card">
<div class="o_fp_card">
<div class="d-flex align-items-start justify-content-between">
<div>
<strong class="o_fp_card_title"><field name="name"/></strong>
<div class="small text-muted"><field name="partner_id"/></div>
</div>
<i class="fa fa-arrow-up text-muted" aria-hidden="true"/>
</div>
<div class="mt-2 small">
<field name="scheduled_date"/>
</div>
<div class="mt-1 small text-muted">
<field name="assigned_driver_id"/>
<span t-if="record.vehicle_id.raw_value"><field name="vehicle_id"/></span>
</div>
<div class="mt-2" t-if="record.tdg_required.raw_value">
<span class="o_fp_badge" data-state="tdg">TDG</span>
</div>
<div class="mt-1 small text-muted" t-if="record.job_ref.raw_value">
Job: <field name="job_ref"/>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_fp_delivery_search" model="ir.ui.view">
<field name="name">fp.delivery.search</field>
<field name="model">fusion.plating.delivery</field>
<field name="arch" type="xml">
<search string="Deliveries">
<field name="name"/>
<field name="partner_id"/>
<field name="assigned_driver_id"/>
<field name="vehicle_id"/>
<field name="job_ref"/>
<field name="source_facility_id"/>
<filter name="filter_draft" string="Draft" domain="[('state','=','draft')]"/>
<filter name="filter_scheduled" string="Scheduled" domain="[('state','=','scheduled')]"/>
<filter name="filter_en_route" string="En Route" domain="[('state','=','en_route')]"/>
<filter name="filter_delivered" string="Delivered" domain="[('state','=','delivered')]"/>
<filter name="filter_tdg" string="TDG Only" domain="[('tdg_required','=',True)]"/>
<group>
<filter name="group_state" string="Status" context="{'group_by':'state'}"/>
<filter name="group_driver" string="Driver" context="{'group_by':'assigned_driver_id'}"/>
<filter name="group_facility" string="Source Facility" context="{'group_by':'source_facility_id'}"/>
<filter name="group_partner" string="Customer" context="{'group_by':'partner_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_fp_delivery" model="ir.actions.act_window">
<field name="name">Deliveries</field>
<field name="res_model">fusion.plating.delivery</field>
<field name="view_mode">kanban,list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No deliveries yet
</p>
<p>
Schedule deliveries of finished parts back to your customers.
Attach a Certificate of Conformance and packing list, track
chain of custody, and capture proof of delivery on site.
</p>
</field>
</record>
</odoo>