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.

51 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(
  9. default=True,
  10. index=True,
  11. )
  12. name = fields.Char(
  13. index=True,
  14. required=True,
  15. translate=True,
  16. )
  17. description = fields.Html(
  18. translate=True, help="How is personal data used here? Why? Etc."
  19. )
  20. controller_id = fields.Many2one(
  21. "res.partner",
  22. string="Controller",
  23. required=True,
  24. default=lambda self: self._default_controller_id(),
  25. help="Whoever determines the purposes and means of the processing "
  26. "of personal data.",
  27. )
  28. processor_ids = fields.Many2many(
  29. "res.partner",
  30. "privacy_activity_res_partner_processor_ids",
  31. string="Processors",
  32. help="Whoever processes personal data on behalf of the controller.",
  33. )
  34. subject_find = fields.Boolean(
  35. "Define subjects",
  36. help="Are affected subjects present in this database?",
  37. )
  38. subject_domain = fields.Char(
  39. "Subjects filter",
  40. default="[]",
  41. help="Selection filter to find specific subjects included.",
  42. )
  43. @api.model
  44. def _default_controller_id(self):
  45. """By default it should be the current user's company."""
  46. return self.env.user.company_id