[FIX] fleet: prevent crash when no cost_ids

This commit is contained in:
mdi-odoo 2014-07-15 11:09:53 +05:30 committed by Richard Mathot
parent 15174e9a70
commit 6e15fb060a
1 changed files with 1 additions and 1 deletions

View File

@ -761,7 +761,7 @@ class fleet_vehicle_log_contract(osv.Model):
def on_change_indic_cost(self, cr, uid, ids, cost_ids, context=None):
totalsum = 0.0
for element in cost_ids:
if element and len(element) == 3 and element[2] is not False:
if element and len(element) == 3 and element[2]:
totalsum += element[2].get('amount', 0.0)
return {
'value': {