Files
odoo_source/addons/fleet/views/fleet_board_view.xml
T
Kevin Baptiste 82df1dfccc [IMP] fleet: model cleanup, dashboard
Purpose
=======

It is currently difficult to know exactly what is used for costs
and services on the contracts.

Hence it make it difficult to evolve the fleet application
We should clean the models in order to have something that is clearer

Specification
=============

Cleanup of models: removed Fuel and Cost. Contract and Services are no
longer inheriting Cost and are seperate models simplifying the use of
Fleet. A contract now has included services and they are no longer
generating cost.

closes odoo/odoo#34090

Taskid: 1931775
Related: odoo/enterprise#4572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-27 11:54:51 +00:00

74 lines
3.4 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="fleet_costs_report_view_search" model="ir.ui.view">
<field name="name">fleet.vehicle.cost.view.search</field>
<field name="model">fleet.vehicle.cost.report</field>
<field name="arch" type="xml">
<search string="Fleet Costs Analysis">
<field name="name" filter_domain="[('name', 'ilike', self)]"/>
<field name="driver_id" filter_domain="[('driver_id', 'ilike', self)]"/>
<field name="date_start" />
<filter string="Service" name="service" domain="[('cost_type', '=', 'service')]"/>
<filter string="Contract" name="contract" domain="[('cost_type', '=', 'contract')]"/>
<group expand="1" string="Group By">
<filter string="Vehicle" name="vehicle" context="{'group_by':'vehicle_id'}"/>
<filter string="Driver" name="driver" context="{'group_by':'driver_id'}"/>
</group>
</search>
</field>
</record>
<record id="fleet_costs_report_view_pivot" model="ir.ui.view">
<field name="name">fleet.vehicle.cost.view.pivot</field>
<field name="model">fleet.vehicle.cost.report</field>
<field name="arch" type="xml">
<pivot>
<field name="date_start" type="col" interval="year" />
<field name="cost_type" type="col" />
<field name="vehicle_id" type="row" />
<field name="cost" type="measure" />
</pivot>
</field>
</record>
<record id="fleet_costs_report_view_graph" model="ir.ui.view">
<field name="name">fleet.vehicle.cost.view.graph</field>
<field name="model">fleet.vehicle.cost.report</field>
<field name="arch" type="xml">
<graph string="Fleet Costs Analysis" type="bar">
<field name="date_start" type="row" interval="month"/>
<field name="cost_type" type="row"/>
<field name="cost" type="measure"/>
</graph>
</field>
</record>
<record id="fleet_costs_reporting_action" model="ir.actions.act_window">
<field name="name">Costs Analysis</field>
<field name="res_model">fleet.vehicle.cost.report</field>
<field name="view_mode">graph,pivot</field>
<field name="view_id"></field>
<field name="context">{ 'time_ranges': {'field':'date_start', 'range':'last_365_days'} }</field>
<field name="search_view_id" ref="fleet.fleet_costs_report_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No data for analysis
</p><p>
Odoo helps you managing the costs for your different vehicles
Costs are generally created from services and contract and appears here.
</p><p>
Thanks to the different filters, Odoo can only print the effective
costs, sort them by type and by vehicle.
</p>
</field>
</record>
<menuitem name="Reporting" parent="menu_root" id="menu_fleet_reporting" sequence="99" groups="fleet_group_manager"/>
<menuitem id="menu_fleet_reporting_costs"
name="Costs"
parent="menu_fleet_reporting"
action="fleet_costs_reporting_action"
sequence="1"
groups="fleet_group_manager"/>
</odoo>