[IMP] fleet: Remove the unicity constraint on the driver

It should be possible to assign 2 vehicles to the same person.

The constraint is too restrictive.
This commit is contained in:
Yannick Tivisse
2018-04-27 17:30:29 +02:00
parent 2bc85571a9
commit 47857a63ac
-4
View File
@@ -73,10 +73,6 @@ class FleetVehicle(models.Model):
car_value = fields.Float(string="Catalog Value (VAT Incl.)", help='Value of the bought vehicle')
residual_value = fields.Float()
_sql_constraints = [
('driver_id_unique', 'UNIQUE(driver_id)', 'Only one car can be assigned to the same employee!')
]
@api.depends('model_id.brand_id.name', 'model_id.name', 'license_plate')
def _compute_vehicle_name(self):
for record in self: