You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
831 B

  1. # Copyright 2018 Eficent Business and IT Consulting Services, S.L.
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import api, models, fields
  4. class MailActivityMixin(models.AbstractModel):
  5. _inherit = 'mail.activity.mixin'
  6. activity_team_user_ids = fields.Many2many(
  7. comodel_name='res.users', string='test field',
  8. compute="_compute_activity_team_user_ids",
  9. search="_search_activity_team_user_ids",
  10. )
  11. @api.depends("activity_ids")
  12. def _compute_activity_team_user_ids(self):
  13. for rec in self:
  14. rec.activity_team_user_ids = rec.activity_ids.mapped(
  15. "team_id.member_ids")
  16. @api.model
  17. def _search_activity_team_user_ids(self, operator, operand):
  18. return [('activity_ids.team_id.member_ids', operator, operand)]