feat: add Geocode Next 20 and Recompute Distances server actions to list view
This commit is contained in:
@@ -1,6 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
|
||||
<!-- Server Action: Geocode Next 20 (appears in list view Action dropdown) -->
|
||||
<record id="action_geocode_next_batch" model="ir.actions.server">
|
||||
<field name="name">Geocode Next 20 Addresses</field>
|
||||
<field name="model_id" ref="model_wt_location_log"/>
|
||||
<field name="binding_model_id" ref="model_wt_location_log"/>
|
||||
<field name="binding_view_types">list,form</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">action = records.env['wt.location.log'].action_geocode_all_pending()</field>
|
||||
</record>
|
||||
|
||||
<!-- Server Action: Compute Distances (appears in list view Action dropdown) -->
|
||||
<record id="action_compute_distances_batch" model="ir.actions.server">
|
||||
<field name="name">Recompute Distances</field>
|
||||
<field name="model_id" ref="model_wt_location_log"/>
|
||||
<field name="binding_model_id" ref="model_wt_location_log"/>
|
||||
<field name="binding_view_types">list,form</field>
|
||||
<field name="state">code</field>
|
||||
<field name="code">records.action_compute_distances()</field>
|
||||
</record>
|
||||
|
||||
<!-- List View -->
|
||||
<record id="wt_location_log_view_list" model="ir.ui.view">
|
||||
<field name="name">wt.location.log.list</field>
|
||||
@@ -66,20 +86,20 @@
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<!-- Search View — dynamic field-based only, no hardcoded values -->
|
||||
<!-- Search View - dynamic field-based only, no hardcoded values -->
|
||||
<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">
|
||||
<!-- Search by any of these fields — autocompletes from existing data -->
|
||||
<!-- Search by any of these fields - autocompletes from existing data -->
|
||||
<field name="name" string="Name"/>
|
||||
<field name="address" string="Address"/>
|
||||
<field name="place_name" string="Place Name"/>
|
||||
<field name="category" string="Category"/>
|
||||
<field name="date" string="Date"/>
|
||||
<field name="travel_mode" string="Travel Mode"/>
|
||||
<!-- Group By — dynamic, shows whatever values exist in data -->
|
||||
<!-- Group By - dynamic, shows whatever values exist in data -->
|
||||
<group expand="1" string="Group By">
|
||||
<filter string="Date" name="group_date" context="{'group_by': 'date'}"/>
|
||||
<filter string="Category" name="group_category" context="{'group_by': 'category'}"/>
|
||||
@@ -97,4 +117,4 @@
|
||||
<field name="search_view_id" ref="wt_location_log_view_search"/>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user