diff --git a/addons/fleet/fleet.py b/addons/fleet/fleet.py index e4c0c87ecd0..f593ae08ea5 100644 --- a/addons/fleet/fleet.py +++ b/addons/fleet/fleet.py @@ -297,31 +297,15 @@ class fleet_vehicle_odometer(osv.Model): def _vehicle_log_name_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): res = self.name_get(cr, uid, ids, context=context) return dict(res) - - def get_month(self, cr, uid, ids, context=None): - if context is None: - context = {} - if not ids: - return [] - months = ['January','February','March','April','May','June','July','August','September','October','November','December'] - reads = self.browse(cr, uid, ids, context=context) - res = [] - for record in reads: - res.append((record.id,months[int(record.date.split('-')[1])-1])) - return res - - def _vehicle_log_month_get_fnc(self, cr, uid, ids, prop, unknow_none, context=None): - res = self.get_month(cr, uid, ids, context=context) - return dict(res) _columns = { 'name' : fields.function(_vehicle_log_name_get_fnc, type="char", string='Name', store=True), 'date' : fields.date('Execution Date'), - 'value' : fields.float('Odometer Value'), + 'value' : fields.float('Odometer Value',group_operator="max"), 'unit': fields.related('vehicle_id','odometer_unit',type="char",string="Unit",store=False, readonly=True), 'vehicle_id' : fields.many2one('fleet.vehicle', 'Vehicle', required=True), - 'month' : fields.function(_vehicle_log_month_get_fnc,string="Month", type="char",size=32, store=True) + } _defaults = { 'date' : time.strftime('%Y-%m-%d') diff --git a/addons/fleet/fleet_view.xml b/addons/fleet/fleet_view.xml index cc041827643..b2af0f5479a 100644 --- a/addons/fleet/fleet_view.xml +++ b/addons/fleet/fleet_view.xml @@ -287,7 +287,6 @@ - fleet.vehicle.log_insurance.form fleet.vehicle.log.insurance @@ -386,9 +385,9 @@ graph - + - + @@ -453,7 +452,6 @@ - @@ -463,8 +461,8 @@ fleet.vehicle.log.fuel graph - - + + @@ -540,7 +538,7 @@ graph - +