Files
Odoo-Modules/fusion-plating/fusion_plating_compliance/views/fp_compliance_event_views.xml
gsinghpal be611876ad changes
2026-04-12 09:09:50 -04:00

116 lines
5.8 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_fp_compliance_event_list" model="ir.ui.view">
<field name="name">fp.compliance.event.list</field>
<field name="model">fusion.plating.compliance.event</field>
<field name="arch" type="xml">
<list string="Compliance Calendar" decoration-danger="state == 'overdue'" decoration-warning="state == 'due'" decoration-success="state == 'done'">
<field name="due_date"/>
<field name="name"/>
<field name="event_type"/>
<field name="facility_id"/>
<field name="permit_id"/>
<field name="regulator_id"/>
<field name="owner_id"/>
<field name="state" widget="badge"/>
</list>
</field>
</record>
<record id="view_fp_compliance_event_form" model="ir.ui.view">
<field name="name">fp.compliance.event.form</field>
<field name="model">fusion.plating.compliance.event</field>
<field name="arch" type="xml">
<form string="Compliance Event">
<header>
<button name="action_mark_done" string="Mark Done" type="object" invisible="state in ('done', 'skipped')" class="oe_highlight"/>
<button name="action_skip" string="Skip" type="object" invisible="state in ('done', 'skipped')"/>
<field name="state" widget="statusbar" statusbar_visible="upcoming,due,overdue,done"/>
</header>
<sheet>
<div class="oe_title">
<label for="name"/>
<h1><field name="name" placeholder="e.g. Submit Annual ECA Report"/></h1>
</div>
<group>
<group>
<field name="event_type"/>
<field name="facility_id"/>
<field name="due_date"/>
<field name="owner_id"/>
</group>
<group>
<field name="permit_id"/>
<field name="regulator_id"/>
</group>
</group>
<group string="Notes"><field name="notes" nolabel="1"/></group>
</sheet>
<chatter/>
</form>
</field>
</record>
<record id="view_fp_compliance_event_kanban" model="ir.ui.view">
<field name="name">fp.compliance.event.kanban</field>
<field name="model">fusion.plating.compliance.event</field>
<field name="arch" type="xml">
<kanban class="o_fp_event_kanban" default_group_by="state">
<field name="id"/>
<field name="name"/>
<field name="event_type"/>
<field name="facility_id"/>
<field name="due_date"/>
<field name="owner_id"/>
<field name="state"/>
<templates>
<t t-name="card">
<div class="o_fp_card" t-att-data-state="record.state.raw_value">
<div class="d-flex align-items-start justify-content-between">
<div>
<strong class="o_fp_card_title"><field name="name"/></strong>
<div class="text-muted small"><field name="event_type"/></div>
</div>
<i class="fa fa-calendar text-muted" aria-hidden="true"/>
</div>
<div class="mt-2 small">Due: <field name="due_date"/></div>
<div t-if="record.facility_id.value" class="mt-1 small">
<field name="facility_id"/>
</div>
<div t-if="record.state.raw_value == 'overdue'" class="o_fp_overdue_indicator mt-2">
Overdue
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_fp_compliance_event_search" model="ir.ui.view">
<field name="name">fp.compliance.event.search</field>
<field name="model">fusion.plating.compliance.event</field>
<field name="arch" type="xml">
<search string="Compliance Calendar">
<field name="name"/>
<field name="facility_id"/>
<field name="permit_id"/>
<field name="owner_id"/>
<filter string="Overdue" name="overdue" domain="[('state', '=', 'overdue')]"/>
<filter string="Due" name="due" domain="[('state', '=', 'due')]"/>
<filter string="Upcoming" name="upcoming" domain="[('state', '=', 'upcoming')]"/>
<filter string="My Events" name="mine" domain="[('owner_id', '=', uid)]"/>
<group>
<filter string="Facility" name="group_facility" context="{'group_by': 'facility_id'}"/>
<filter string="Type" name="group_type" context="{'group_by': 'event_type'}"/>
<filter string="Status" name="group_state" context="{'group_by': 'state'}"/>
<filter string="Owner" name="group_owner" context="{'group_by': 'owner_id'}"/>
</group>
</search>
</field>
</record>
<record id="action_fp_compliance_event" model="ir.actions.act_window">
<field name="name">Compliance Calendar</field>
<field name="res_model">fusion.plating.compliance.event</field>
<field name="view_mode">kanban,list,form</field>
<field name="search_view_id" ref="view_fp_compliance_event_search"/>
</record>
</odoo>