From e27a4e80016440b54221a3e950f11aeccd894a1f Mon Sep 17 00:00:00 2001 From: eLBati Date: Mon, 25 Mar 2024 14:37:42 +0100 Subject: [PATCH] [FIX] helpdesk_mgmt: company_id should come from team Otherwise, creating tickets from fetchmail would always set odoobot's company in new tickets, potentially in contrast to team's company --- helpdesk_mgmt/models/helpdesk_ticket.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/helpdesk_mgmt/models/helpdesk_ticket.py b/helpdesk_mgmt/models/helpdesk_ticket.py index 513e7db989..d463924265 100644 --- a/helpdesk_mgmt/models/helpdesk_ticket.py +++ b/helpdesk_mgmt/models/helpdesk_ticket.py @@ -67,10 +67,7 @@ def _read_group_stage_ids(self, stages, domain, order): unattended = fields.Boolean(related="stage_id.unattended", store=True) tag_ids = fields.Many2many(comodel_name="helpdesk.ticket.tag", string="Tags") company_id = fields.Many2one( - comodel_name="res.company", - string="Company", - required=True, - default=lambda self: self.env.company, + related="team_id.company_id", string="Company", store=True, readonly=True ) channel_id = fields.Many2one( comodel_name="helpdesk.ticket.channel",