feat: add travel mode and category quick-filter buttons to search view
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-14 05:28:14 +00:00
parent 1ccc83a64e
commit 2406fc9aa8

View File

@@ -86,23 +86,37 @@
</field> </field>
</record> </record>
<!-- Search View - dynamic field-based only, no hardcoded values --> <!-- Search View -->
<record id="wt_location_log_view_search" model="ir.ui.view"> <record id="wt_location_log_view_search" model="ir.ui.view">
<field name="name">wt.location.log.search</field> <field name="name">wt.location.log.search</field>
<field name="model">wt.location.log</field> <field name="model">wt.location.log</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Search Location Logs"> <search string="Search Location Logs">
<!-- Search by any of these fields - autocompletes from existing data --> <!-- Full-text search fields -->
<field name="name" string="Name"/> <field name="name" string="Name"/>
<field name="address" string="Address"/> <field name="address" string="Address"/>
<field name="place_name" string="Place Name"/> <field name="place_name" string="Place Name"/>
<field name="category" string="Category"/> <field name="category" string="Category"/>
<field name="date" string="Date"/> <field name="date" string="Date"/>
<field name="travel_mode" string="Travel Mode"/>
<!-- Group By - dynamic, shows whatever values exist in data --> <!-- Travel Mode quick filters -->
<separator/>
<filter string="Driving" name="filter_driving" domain="[('travel_mode','=','driving')]"/>
<filter string="Walking" name="filter_walking" domain="[('travel_mode','=','walking')]"/>
<filter string="Cycling" name="filter_cycling" domain="[('travel_mode','=','cycling')]"/>
<filter string="Flying" name="filter_flying" domain="[('travel_mode','=','flying')]"/>
<filter string="Transit" name="filter_transit" domain="[('travel_mode','=','transit')]"/>
<filter string="Unknown" name="filter_unknown" domain="[('travel_mode','=','unknown')]"/>
<!-- Category quick filters -->
<separator/>
<filter string="Home" name="filter_home" domain="[('category','in',['Home'])]"/>
<filter string="Work" name="filter_work" domain="[('category','in',['Work'])]"/>
<!-- Group By -->
<group expand="1" string="Group By"> <group expand="1" string="Group By">
<filter string="Date" name="group_date" context="{'group_by': 'date'}"/> <filter string="Date" name="group_date" context="{'group_by': 'date'}"/>
<filter string="Category" name="group_category" context="{'group_by': 'category'}"/> <filter string="Category" name="group_category" context="{'group_by': 'category'}"/>
<filter string="Travel Mode" name="group_travel_mode" context="{'group_by': 'travel_mode'}"/> <filter string="Travel Mode" name="group_travel_mode" context="{'group_by': 'travel_mode'}"/>
</group> </group>
</search> </search>