[IMP]:Fleet Management

bzr revid: aja@tinyerp.com-20130318104228-yti1y8hri248ppy3
This commit is contained in:
ajay javiya (OpenERP)
2013-03-18 16:12:28 +05:30
parent 914a97f329
commit a71ed635f3
2 changed files with 32 additions and 7 deletions
+2 -2
View File
@@ -77,7 +77,7 @@ class fleet_vehicle_cost(osv.Model):
'name': fields.function(_cost_name_get_fnc, type="char", string='Name', store=True),
'vehicle_id': fields.many2one('fleet.vehicle', 'Vehicle', required=True, help='Vehicle concerned by this log'),
'cost_subtype_id': fields.many2one('fleet.service.type', 'Type', help='Cost type purchased with this cost'),
'amount': fields.float('Total Price'),
'amount': fields.float('Total Price', help="Cost that is paid only once at the creation of the contract"),
'cost_type': fields.selection([('contract', 'Contract'), ('services','Services'), ('fuel','Fuel'), ('other','Other')], 'Category of the cost', help='For internal purpose only', required=True),
'parent_id': fields.many2one('fleet.vehicle.cost', 'Parent', help='Parent cost to this current cost'),
'cost_ids': fields.one2many('fleet.vehicle.cost', 'parent_id', 'Included Services'),
@@ -394,7 +394,7 @@ class fleet_vehicle(osv.Model):
def create(self, cr, uid, data, context=None):
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):
+30 -5
View File
@@ -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"/> Unit
</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>
@@ -591,7 +601,9 @@
<field name="view_mode">tree,graph</field>
<field name="context">{"search_default_groupby_vehicle" : True}</field>
<field name="help" type="html">
<p>
<p class="oe_view_nocontent_create">
Click to create a new odometer entry.
</p><p>
Here you can add various odometer entries for all vehicles.
You can also show odometer value for a particular vehicle using
the search field.
@@ -764,6 +776,19 @@
</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" >
<group expand="1" string="Group By...">
<filter name="groupby_vehicle" context="{'group_by' : 'vehicle_id'}" string="Vehicle"/>
<filter name="groupby_service_type" context="{'group_by' : 'cost_subtype_id'}" string="Service Type"/>
</group>
</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>
@@ -786,7 +811,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>