2012-07-30 07:03:29 +00:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# OpenERP, Open Source Management Solution
|
2012-09-19 11:00:35 +00:00
|
|
|
# Copyright (C) 2012-today OpenERP SA (<http://www.openerp.com>)
|
2012-07-30 07:03:29 +00:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Affero General Public License as
|
|
|
|
# published by the Free Software Foundation, either version 3 of the
|
|
|
|
# License, or (at your option) any later version
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Affero General Public License for more details
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU Affero General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
2012-12-06 14:56:32 +00:00
|
|
|
from openerp.osv import osv
|
|
|
|
from openerp.osv import fields
|
2012-07-30 07:03:29 +00:00
|
|
|
|
2012-09-19 11:00:35 +00:00
|
|
|
|
2012-07-30 07:03:29 +00:00
|
|
|
class mail_message_subtype(osv.osv):
|
2012-09-19 11:00:35 +00:00
|
|
|
""" Class holding subtype definition for messages. Subtypes allow to tune
|
|
|
|
the follower subscription, allowing only some subtypes to be pushed
|
|
|
|
on the Wall. """
|
2012-07-30 07:03:29 +00:00
|
|
|
_name = 'mail.message.subtype'
|
2012-12-18 12:25:58 +00:00
|
|
|
_description = 'Message subtypes'
|
2012-07-30 07:03:29 +00:00
|
|
|
_columns = {
|
2012-10-02 20:40:23 +00:00
|
|
|
'name': fields.char('Message Type', required=True, translate=True,
|
2012-11-02 14:57:11 +00:00
|
|
|
help='Message subtype gives a more precise type on the message, '\
|
2012-09-19 11:00:35 +00:00
|
|
|
'especially for system notifications. For example, it can be '\
|
|
|
|
'a notification related to a new record (New), or to a stage '\
|
|
|
|
'change in a process (Stage change). Message subtypes allow to '\
|
|
|
|
'precisely tune the notifications the user want to receive on its wall.'),
|
2012-12-18 12:25:58 +00:00
|
|
|
'description': fields.text('Description', translate=True,
|
|
|
|
help='Description that will be added in the message posted for this '\
|
|
|
|
'subtype. If void, no message will be added.'),
|
2012-12-18 15:34:57 +00:00
|
|
|
'parent_id': fields.many2one('mail.message.subtype', string='Parent',
|
|
|
|
ondelete='set null'),
|
|
|
|
'parent_field': fields.char('Parent field',
|
|
|
|
help='Field used to find the parent model'),
|
2012-11-02 14:57:11 +00:00
|
|
|
'res_model': fields.char('Model',
|
2012-12-18 12:25:58 +00:00
|
|
|
help="Model the subtype applies to. If False, this subtype exists for all models."),
|
2012-09-19 11:00:35 +00:00
|
|
|
'default': fields.boolean('Default',
|
2012-12-18 12:25:58 +00:00
|
|
|
help="Activated by default when subscribing."),
|
2012-07-30 07:03:29 +00:00
|
|
|
}
|
|
|
|
_defaults = {
|
|
|
|
'default': True,
|
|
|
|
}
|