From aa791a646b5d52f8c56b13ac7f01601cbb345d5d Mon Sep 17 00:00:00 2001 From: svs-odoo Date: Tue, 17 Sep 2019 08:07:34 +0000 Subject: [PATCH] [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) --- addons/maintenance/models/maintenance.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/maintenance/models/maintenance.py b/addons/maintenance/models/maintenance.py index 4b5fa62bcfa..56f14057740 100644 --- a/addons/maintenance/models/maintenance.py +++ b/addons/maintenance/models/maintenance.py @@ -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