[FIX] maintenance: company id of generated request
When an user generate new maintenance request, the company id was the user's one, which can cause issue if the company of the user and of the equipment aren't the same. Now, the company id of the request is took from the equipment if it has one. closes odoo/odoo#36927 Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -244,6 +244,7 @@ class MaintenanceEquipment(models.Model):
|
||||
'user_id': self.technician_user_id.id,
|
||||
'maintenance_team_id': self.maintenance_team_id.id,
|
||||
'duration': self.maintenance_duration,
|
||||
'company_id': self.company_id.id or self.env.company.id
|
||||
})
|
||||
|
||||
@api.model
|
||||
|
||||
Reference in New Issue
Block a user