[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:
svs-odoo
2019-09-17 08:30:13 +00:00
parent aed58b4b9a
commit aa791a646b
+1
View File
@@ -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