From fe065c137dbefa1f816c09f2a54d443f55243f34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibault=20Delavall=C3=A9e?= Date: Wed, 1 Feb 2012 17:49:02 +0100 Subject: [PATCH] Moved subscription model from mail_group to mail_subscription file bzr revid: tde@openerp.com-20120201164902-ensm98a517vdz9nb --- addons/mail/__init__.py | 1 + addons/mail/__openerp__.py | 1 + addons/mail/mail_group.py | 24 ------------- addons/mail/mail_subscription.py | 48 ++++++++++++++++++++++++++ addons/mail/mail_subscription_view.xml | 0 5 files changed, 50 insertions(+), 24 deletions(-) create mode 100644 addons/mail/mail_subscription.py create mode 100644 addons/mail/mail_subscription_view.xml diff --git a/addons/mail/__init__.py b/addons/mail/__init__.py index c7fffb3a338..64339fcb9c0 100644 --- a/addons/mail/__init__.py +++ b/addons/mail/__init__.py @@ -22,6 +22,7 @@ import mail_message import mail_thread import mail_group +import mail_subscription import res_partner import wizard diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py index 5e52e103852..ed28c5be365 100644 --- a/addons/mail/__openerp__.py +++ b/addons/mail/__openerp__.py @@ -59,6 +59,7 @@ The main features are: "wizard/mail_compose_message_view.xml", "mail_message_view.xml", "mail_group_view.xml", + "mail_subscription_view.xml", "mail_thread_view.xml", "res_partner_view.xml", 'security/ir.model.access.csv', diff --git a/addons/mail/mail_group.py b/addons/mail/mail_group.py index 996f9f174ae..55587850872 100644 --- a/addons/mail/mail_group.py +++ b/addons/mail/mail_group.py @@ -124,27 +124,3 @@ class mail_group(osv.osv): mail_group() - - -class mail_subscription(osv.osv): - """ - mail_subscription holds the data related to the follow mechanism inside OpenERP. - A subscription can be of following: - - res_model: model of the followed objects - - res_id: ID of resource OR - - res_domain: a domain filtering followed objects - """ - - _name = 'mail.subscription' - _rec_name = 'id' - _columns = { - 'res_model': fields.char('Related Document model', size=128, select=1), - 'res_id': fields.integer('Related Document ID', select=1), - 'res_domain': fields.char('res_domain', size=256), - 'user_id': fields.integer('Related User ID', select=1), - } - - _defaults = { - } - -mail_subscription() diff --git a/addons/mail/mail_subscription.py b/addons/mail/mail_subscription.py new file mode 100644 index 00000000000..ce509a52735 --- /dev/null +++ b/addons/mail/mail_subscription.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2010-2011 OpenERP SA () +# +# 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 +# +############################################################################## + +import tools +from osv import osv +from osv import fields +from tools.translate import _ + +class mail_subscription(osv.osv): + """ + mail_subscription holds the data related to the follow mechanism inside OpenERP. + A subscription can be of following: + - res_model: model of the followed objects + - res_id: ID of resource OR + - res_domain: a domain filtering followed objects + """ + + _name = 'mail.subscription' + _rec_name = 'id' + _columns = { + 'res_model': fields.char('Related Document model', size=128, select=1), + 'res_id': fields.integer('Related Document ID', select=1), + 'res_domain': fields.char('res_domain', size=256), + 'user_id': fields.integer('Related User ID', select=1), + } + + _defaults = { + } + +mail_subscription() diff --git a/addons/mail/mail_subscription_view.xml b/addons/mail/mail_subscription_view.xml new file mode 100644 index 00000000000..e69de29bb2d