Skip to content
Snippets Groups Projects
Commit 3c388e7c authored by alt-odoo's avatar alt-odoo
Browse files

[FIX] fleet: set correct contract on activation cost line creation

When creating a vehicle contract, we are creating automatically a cost line
corresponding to the activation costs. The contract was not correctly set
on that line before this commit.
parent 501e32b2
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,12 @@ class FleetVehicleLogContract(models.Model):
if self.vehicle_id:
self.odometer_unit = self.vehicle_id.odometer_unit
@api.model_create_multi
def create(self, vals):
res = super(FleetVehicleLogContract, self).create(vals)
res.cost_id.write({'contract_id': res.id})
return res
@api.multi
def write(self, vals):
res = super(FleetVehicleLogContract, self).write(vals)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment