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.

38 lines
1.7 KiB

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