[FIX]correct a small bug when creating odometer with value zero

bzr revid: csn@openerp.com-20121107151726-xr6754fd9t39k5zc
This commit is contained in:
Cedric Snauwaert 2012-11-07 16:17:26 +01:00
parent 19f710b03a
commit 2665f36934
1 changed files with 2 additions and 0 deletions

View File

@ -102,6 +102,8 @@ class fleet_vehicle_cost(osv.Model):
data['vehicle_id'] = contract.vehicle_id.id
data['cost_subtype'] = contract.cost_subtype.id
data['cost_type'] = contract.cost_type
if 'odometer' in data and not data['odometer']:
del(data['odometer'])
return super(fleet_vehicle_cost, self).create(cr, uid, data, context=context)