The name of a vehicle is function field.
The field odometer on a vehicle has a a setter that creates an odometer.
The name of an odometer is a function field that uses the name of the vehicle.
If a vehicle is created with a value in odometer field, the odometer is created before the name is computed so the concatanation would fail.
Fixes #3468
res = {}
for record in self.browse(cr, uid, ids, context=context):
name = record.vehicle_id.name
- if record.date:
- name = name+ ' / '+ str(record.date)
+ if not name:
+ name = record.date
+ elif record.date:
+ name += ' / '+ record.date
res[record.id] = name
return res