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.

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