1 # -*- coding: utf-8 -*-
2 ##############################################################################
4 # OpenERP, Open Source Management Solution
5 # Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
7 # This program is free software: you can redistribute it and/or modify
8 # it under the terms of the GNU Affero General Public License as
9 # published by the Free Software Foundation, either version 3 of the
10 # License, or (at your option) any later version
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU Affero General Public License for more details
17 # You should have received a copy of the GNU Affero General Public License
18 # along with this program. If not, see <http://www.gnu.org/licenses/>
20 ##############################################################################
22 from openerp.osv import osv
23 from openerp.osv import fields
26 class mail_message_subtype(osv.osv):
27 """ Class holding subtype definition for messages. Subtypes allow to tune
28 the follower subscription, allowing only some subtypes to be pushed
30 _name = 'mail.message.subtype'
31 _description = 'Message subtypes'
33 'name': fields.char('Message Type', required=True, translate=True,
34 help='Message subtype gives a more precise type on the message, '\
35 'especially for system notifications. For example, it can be '\
36 'a notification related to a new record (New), or to a stage '\
37 'change in a process (Stage change). Message subtypes allow to '\
38 'precisely tune the notifications the user want to receive on its wall.'),
39 'description': fields.text('Description', translate=True,
40 help='Description that will be added in the message posted for this '\
41 'subtype. If void, the name will be added instead.'),
42 'parent_id': fields.many2one('mail.message.subtype', string='Parent',
44 help='Parent subtype, used for automatic subscription.'),
45 'relation_field': fields.char('Relation field',
46 help='Field used to link the related model to the subtype model when '\
47 'using automatic subscription on a related document. The field '\
48 'is used to compute getattr(related_document.relation_field).'),
49 'res_model': fields.char('Model',
50 help="Model the subtype applies to. If False, this subtype applies to all models."),
51 'default': fields.boolean('Default',
52 help="Activated by default when subscribing."),