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.

43 lines
1.5 KiB

  1. # Copyright 2018 Tecnativa - Jairo Llopis
  2. # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
  3. from odoo import api, fields, models
  4. class PrivacyActivity(models.Model):
  5. _name = "privacy.activity"
  6. _description = "Data processing activities"
  7. _inherit = ["mail.thread", "mail.activity.mixin"]
  8. active = fields.Boolean(default=True, index=True,)
  9. name = fields.Char(index=True, required=True, translate=True,)
  10. description = fields.Html(
  11. translate=True, help="How is personal data used here? Why? Etc."
  12. )
  13. controller_id = fields.Many2one(
  14. "res.partner",
  15. string="Controller",
  16. required=True,
  17. default=lambda self: self._default_controller_id(),
  18. help="Whoever determines the purposes and means of the processing "
  19. "of personal data.",
  20. )
  21. processor_ids = fields.Many2many(
  22. "res.partner",
  23. "privacy_activity_res_partner_processor_ids",
  24. string="Processors",
  25. help="Whoever processes personal data on behalf of the controller.",
  26. )
  27. subject_find = fields.Boolean(
  28. "Define subjects", help="Are affected subjects present in this database?",
  29. )
  30. subject_domain = fields.Char(
  31. "Subjects filter",
  32. default="[]",
  33. help="Selection filter to find specific subjects included.",
  34. )
  35. @api.model
  36. def _default_controller_id(self):
  37. """By default it should be the current user's company."""
  38. return self.env.user.company_id