[FIX] mail_activity_team: singleton in _compute_activity_team_id()

pull/1569/head
Alexey Pelykh 2025-01-31 08:48:40 +01:00
parent e34d707583
commit 50d44673a9
2 changed files with 4 additions and 1 deletions

View File

@ -12,3 +12,5 @@
- [Camptocamp] (https://camptocamp.com):
- Vincent Van Rossem <vincent.vanrossem@camptocamp.com>
- Italo Lopes <italo.lopes@camptocamp.com>
- [CorporateHub](https://corporatehub.eu/)
- Alexey Pelykh <alexey.pelykh@corphub.eu>

View File

@ -1,4 +1,5 @@
# Copyright 2024 Camptocamp SA
# Copyright 2024 CorporateHub
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
@ -26,7 +27,7 @@ class MailActivitySchedule(models.TransientModel):
elif not scheduler.activity_team_id:
scheduler.activity_team_id = (
self.env["mail.activity"]
.with_context(default_res_model=self.sudo().res_model_id.model)
.with_context(default_res_model=scheduler.sudo().res_model_id.model)
._get_default_team_id(user_id=scheduler.activity_team_user_id.id)
)