[FIX] fleet: contract onchange: ensure dict before executing `get`

This commit is contained in:
Simon Lejeune 2014-09-26 18:36:13 +02:00
parent 30a0814159
commit d0eed7f9fc
1 changed files with 1 additions and 1 deletions

View File

@ -751,7 +751,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]:
if element and len(element) == 3 and isinstance(element[2], dict):
totalsum += element[2].get('amount', 0.0)
return {
'value': {