[FIX] hr_fleet: fixes demo data vehicle assignation logs
In the demo data from hr_fleet, we add address_home_id's to some employees in order to create the correct vehicle assignation logs. However, as the driver_id is already set at that moment, the _compute_driver_employee_id is not called again as no dependency was changed, resulting in an empty driver_employee_id for some logs. This commit fixes this by calling the compute method on the demo data with the assignation logs that have no driver_employee_id set and have a driver_id. task-2742923 Part-of: odoo/odoo#83755
This commit is contained in:
@@ -29,4 +29,10 @@
|
||||
<record id="fleet.vehicle_5" model="fleet.vehicle">
|
||||
<field name="driver_employee_id" ref="hr.employee_jep"/>
|
||||
</record>
|
||||
|
||||
<!-- recompute driver_employee_id as we assigned a proper address_home_id to some employees -->
|
||||
<function model="fleet.vehicle.assignation.log" name="_compute_driver_employee_id">
|
||||
<value model="fleet.vehicle.assignation.log" eval="obj().search([('driver_employee_id', '=', False), ('driver_id', '!=', False)]).ids"/>
|
||||
</function>
|
||||
|
||||
</odoo>
|
||||
|
||||
Reference in New Issue
Block a user