[IMP] fleet: minor changes to views

Adds two new columns to the vehicle model tree view.
Changes the name of the vehicle model action.
Modifies the order by which vehicle manufacturers are ordered.
Adds filter and modify goupby on vehicle, vehicle model/brand.

Task ID: 2487706
This commit is contained in:
William Braeckman
2021-06-04 07:20:15 +00:00
committed by Yannick Tivisse
parent 9b5768688a
commit e85763d982
3 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ class FleetVehicleModel(models.Model):
class FleetVehicleModelBrand(models.Model):
_name = 'fleet.vehicle.model.brand'
_description = 'Brand of the vehicle'
_order = 'model_count desc, name asc'
_order = 'name asc'
name = fields.Char('Make', required=True)
image_128 = fields.Image("Logo", max_width=128, max_height=128)
@@ -68,6 +68,7 @@
<tree string="Models">
<field name="brand_id" />
<field name="name" />
<field name="vehicle_count" string="Vehicles"/>
<field name="category_id" optional="show"/>
<field name="vehicle_type" optional="show"/>
</tree>
@@ -98,14 +99,14 @@
<search string="Vehicles costs" >
<field name="brand_id" />
<group expand="1" string="Group By">
<filter name="groupby_brand" context="{'group_by' : 'brand_id'}" string="Make"/>
<filter name="groupby_brand" context="{'group_by' : 'brand_id'}" string="Contains Vehicles"/>
</group>
</search>
</field>
</record>
<record id='fleet_vehicle_model_action' model='ir.actions.act_window'>
<field name="name">Vehicles Model</field>
<field name="name">Models</field>
<field name="res_model">fleet.vehicle.model</field>
<field name="view_mode">tree,form</field>
<field name="context">{"search_default_groupby_brand" : True,}</field>
@@ -193,6 +193,7 @@
<filter string="Status" name="groupby_status" context="{'group_by': 'state_id'}"/>
<filter string="Model" name="groupby_model" context="{'group_by': 'model_id'}"/>
<filter string="Brand" name="groupby_make" context="{'group_by': 'brand_id'}"/>
<filter string="Fuel Type" name="groupby_fueltype" context="{'group_by': 'fuel_type'}"/>
</group>
</search>
</field>