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.

41 lines
1.8 KiB

  1. # -*- coding: utf-8 -*-
  2. # Copyright 2016 Odoo SA <https://www.odoo.com>
  3. # Copyright 2018 Therp BV <http://therp.nl>
  4. # Copyright 2018 Eficent <http://www.eficent.com>
  5. # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl.html).
  6. from odoo import fields, models
  7. class MailActivityType(models.Model):
  8. """ Activity Types are used to categorize activities. Each type is a
  9. different kind of activity e.g. call, mail, meeting. An activity can be
  10. generic i.e. available for all models using activities; or specific to a
  11. model in which case res_model_id field should be used. """
  12. _name = 'mail.activity.type'
  13. _description = 'Activity Type'
  14. _rec_name = 'name'
  15. _order = 'sequence, id'
  16. name = fields.Char('Name', required=True, translate=True)
  17. summary = fields.Char('Summary', translate=True)
  18. sequence = fields.Integer('Sequence', default=10)
  19. days = fields.Integer(
  20. '# Days', default=0,
  21. help='Number of days before executing the action. It allows to plan '
  22. 'the action deadline.')
  23. icon = fields.Char('Icon', help="Font awesome icon e.g. fa-tasks")
  24. res_model_id = fields.Many2one(
  25. 'ir.model', 'Model', index=True,
  26. help='Specify a model if the activity should be specific to a model'
  27. 'and not available when managing activities for other models.')
  28. next_type_ids = fields.Many2many(
  29. 'mail.activity.type', 'mail_activity_rel', 'activity_id',
  30. 'recommended_id', string='Recommended Next Activities')
  31. previous_type_ids = fields.Many2many(
  32. 'mail.activity.type', 'mail_activity_rel', 'recommended_id',
  33. 'activity_id', string='Preceding Activities')
  34. category = fields.Selection([
  35. ('default', 'Other')], default='default',
  36. string='Category',
  37. help='Categories may trigger specific behavior like opening calendar '
  38. 'view')