summaryrefslogtreecommitdiff
path: root/addons/fleet
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@openerp.com>2013-09-06 10:35:00 +0200
committerChristophe Matthieu <chm@openerp.com>2013-09-06 10:35:00 +0200
commit8a3f1742e0e9c7acaae726e5c7106d2d7df7e970 (patch)
tree78ae5d981fcd25677caea5c8b3999b1e77bf4547 /addons/fleet
parent6f6c59ec1de1881a70e4bf728ea5d8b56bd609f9 (diff)
parentc80cf7d0646463b290137c26fbada568a6942b00 (diff)
[MERGE] from website-al
bzr revid: chm@openerp.com-20130906083500-4n5knaxiqt4cg2ht
Diffstat (limited to 'addons/fleet')
-rw-r--r--addons/fleet/fleet.py7
-rw-r--r--addons/fleet/fleet_view.xml39
2 files changed, 35 insertions, 11 deletions
diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py
index dc2aabb54fc..483f989fcde 100644
--- a/addons/fleet/fleet.py
+++ b/addons/fleet/fleet.py
@@ -351,7 +351,7 @@ class fleet_vehicle(osv.Model):
'fuel_type': fields.selection([('gasoline', 'Gasoline'), ('diesel', 'Diesel'), ('electric', 'Electric'), ('hybrid', 'Hybrid')], 'Fuel Type', help='Fuel Used by the vehicle'),
'horsepower': fields.integer('Horsepower'),
'horsepower_tax': fields.float('Horsepower Taxation'),
- 'power': fields.integer('Power (kW)', help='Power in kW of the vehicle'),
+ 'power': fields.integer('Power', help='Power in kW of the vehicle'),
'co2': fields.float('CO2 Emissions', help='CO2 emissions of the vehicle'),
'image': fields.related('model_id', 'image', type="binary", string="Logo"),
'image_medium': fields.related('model_id', 'image_medium', type="binary", string="Logo"),
@@ -392,9 +392,12 @@ class fleet_vehicle(osv.Model):
}
def create(self, cr, uid, data, context=None):
+ if not context:
+ context = {}
+ context.update({'mail_create_nolog': True})
vehicle_id = super(fleet_vehicle, self).create(cr, uid, data, context=context)
vehicle = self.browse(cr, uid, vehicle_id, context=context)
- self.message_post(cr, uid, [vehicle_id], body=_('Vehicle %s has been added to the fleet!') % (vehicle.license_plate), context=context)
+ self.message_post(cr, uid, [vehicle_id], body=_('%s %s has been added to the fleet!') % (vehicle.model_id.name,vehicle.license_plate), context=context)
return vehicle_id
def write(self, cr, uid, ids, vals, context=None):
diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml
index a8f6a321daf..05030cb3488 100644
--- a/addons/fleet/fleet_view.xml
+++ b/addons/fleet/fleet_view.xml
@@ -13,7 +13,7 @@
<h1>
<field name="modelname" />
</h1>
- <label for="brand" class="oe_edit_only"/>
+ <label for="brand_id" class="oe_edit_only"/>
<h2>
<field name="brand_id" on_change="on_change_brand(brand_id)"/>
</h2>
@@ -242,11 +242,17 @@
<group string="Engine Options">
<field name="transmission" />
<field name="fuel_type" />
- <field name="co2" />
+ <label for="co2"/>
+ <div>
+ <field name="co2" class="oe_inline"/> g/km
+ </div>
<field name="horsepower" />
<field name="horsepower_tax" />
- <field name="power" />
- </group>
+ <label for="power"/>
+ <div>
+ <field name="power" class="oe_inline"/> kW
+ </div>
+ </group>
</group>
</sheet>
<div class="oe_chatter">
@@ -287,6 +293,10 @@
<field name="location"/>
<field name="state_id" />
<filter name="alert_true" domain="['|',('contract_renewal_due_soon','=',True),('contract_renewal_overdue','=',True)]" string="Has Alert(s)"/>
+ <group expand="1" string="Group By...">
+ <filter name="groupby_status" context="{'group_by' : 'state_id'}" string="Status"/>
+ <filter name="groupby_model" context="{'group_by' : 'model_id'}" string="Model"/>
+ </group>
</search>
</field>
</record>
@@ -400,7 +410,7 @@
<group string="Contract details">
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
<field name="cost_subtype_id" required="1" domain="['|',('category','=','contract'),('category','=','both')]"/>
- <field name="amount" string="Activation Cost"/>
+ <field name="amount" string="Activation Cost" help="Cost that is paid only once at the creation of the contract"/>
<label for="cost_generated"/>
<div>
<field name="cost_generated" class="oe_inline" attrs="{'invisible': [('cost_frequency','=','no')]}" />
@@ -440,7 +450,7 @@
</group>
<div class="oe_right"><group><field name="sum_cost" string="Indicative Costs Total"/></group></div>
</page>
- <page string="Generated Costs">
+ <page string="Generated Recurring Costs">
<group>
<field name="generated_cost_ids" context="{'vehicle_id': vehicle_id}" nolabel="1" sum="amount">
<tree version="7.0" editable="bottom" >
@@ -704,7 +714,7 @@
<group string="Services Details">
<field name="vehicle_id" on_change="on_change_vehicle(vehicle_id)"/>
<field name="cost_subtype_id" string="Service Type" domain="['|',('category','=','service'),('category','=','both')]" required="1"/>
- <field name="amount" string="Price"/>
+ <field name="amount"/>
</group>
<group string="Odometer Details">
<label for="odometer"/>
@@ -726,7 +736,7 @@
<field name="cost_ids" nolabel="1">
<tree string="Included Services" version="7.0" editable="bottom">
<field name="cost_subtype_id" string="Service" domain="[('category','=','service')]"/>
- <field name="amount" sum="Price" string="Cost"/>
+ <field name="amount" sum="Price" string="Indicative Cost"/>
</tree>
</field>
</group>
@@ -767,6 +777,17 @@
</field>
</record>
+ <record model='ir.ui.view' id='fleet_vehicle_log_services_search'>
+ <field name="name">fleet.vehicle.log.services.search</field>
+ <field name="model">fleet.vehicle.log.services</field>
+ <field name="arch" type="xml">
+ <search string="Services Logs" >
+ <field name="vehicle_id"/>
+ <field name="cost_subtype_id"/>
+ </search>
+ </field>
+ </record>
+
<record model='ir.actions.act_window' id='fleet_vehicle_log_services_act'>
<field name="name">Vehicles Services Logs</field>
<field name="res_model">fleet.vehicle.log.services</field>
@@ -789,7 +810,7 @@
<field name="name">fleet.service.type.tree</field>
<field name="model">fleet.service.type</field>
<field name="arch" type="xml">
- <tree string="Service types" editable="bottom">
+ <tree string="Service types" editable="top">
<field name="name" />
<field name="category"/>
</tree>