Phase 1: Add location log views
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
2026-03-13 22:33:03 +00:00
parent 3d15443c46
commit a6473957f2

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- List View -->
<record id="wt_location_log_view_list" model="ir.ui.view">
<field name="name">wt.location.log.list</field>
<field name="model">wt.location.log</field>
<field name="arch" type="xml">
<list string="Location Logs" default_order="arrived_at asc">
<field name="date"/>
<field name="arrived_at"/>
<field name="departed_at"/>
<field name="name"/>
<field name="address"/>
<field name="time_at_location" widget="float_time"/>
<field name="distance_from_previous"/>
<field name="travel_time_from_previous" widget="float_time"/>
<field name="travel_mode"/>
<field name="source"/>
</list>
</field>
</record>
<!-- Form View -->
<record id="wt_location_log_view_form" model="ir.ui.view">
<field name="name">wt.location.log.form</field>
<field name="model">wt.location.log</field>
<field name="arch" type="xml">
<form string="Location Log">
<header>
<button name="action_geocode" string="Resolve Address" type="object" class="btn-primary"/>
<button name="action_compute_distances" string="Compute Distances" type="object"/>
</header>
<sheet>
<group>
<group string="Location">
<field name="date"/>
<field name="place_name"/>
<field name="address"/>
<field name="latitude"/>
<field name="longitude"/>
</group>
<group string="Timing">
<field name="arrived_at"/>
<field name="departed_at"/>
<field name="time_at_location" widget="float_time"/>
</group>
</group>
<group>
<group string="Travel">
<field name="distance_from_previous"/>
<field name="travel_time_from_previous" widget="float_time"/>
<field name="travel_mode"/>
</group>
<group string="Settings">
<field name="source"/>
<field name="add_to_calendar"/>
<field name="calendar_event_id"/>
</group>
</group>
<group string="Notes">
<field name="notes" nolabel="1"/>
</group>
</sheet>
</form>
</field>
</record>
<!-- Search View -->
<record id="wt_location_log_view_search" model="ir.ui.view">
<field name="name">wt.location.log.search</field>
<field name="model">wt.location.log</field>
<field name="arch" type="xml">
<search string="Search Location Logs">
<field name="name"/>
<field name="address"/>
<field name="place_name"/>
<field name="date"/>
<filter string="Today" name="today" domain="[('date','=', context_today().strftime('%Y-%m-%d'))]"/>
<filter string="This Week" name="this_week" domain="[('date','&gt;=', (context_today() - datetime.timedelta(days=7)).strftime('%Y-%m-%d'))]"/>
<group expand="0" string="Group By">
<filter string="Date" name="group_date" context="{'group_by': 'date'}"/>
<filter string="Travel Mode" name="group_travel_mode" context="{'group_by': 'travel_mode'}"/>
</group>
</search>
</field>
</record>
<!-- Action -->
<record id="wt_location_log_action" model="ir.actions.act_window">
<field name="name">Location Logs</field>
<field name="res_model">wt.location.log</field>
<field name="view_mode">list,form</field>
<field name="search_view_id" ref="wt_location_log_view_search"/>
</record>
</odoo>