diff options
| author | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-07-30 12:33:29 +0530 |
|---|---|---|
| committer | Foram Katharotiya (OpenERP) <fka@tinyerp.com> | 2012-07-30 12:33:29 +0530 |
| commit | cb473c4ffccfbf680d5bcbb6b64753315beeeac4 (patch) | |
| tree | 23223ba7aea76a87e4dd515184169c7fa3266977 | |
| parent | 003ac3c0535949190c7d264e87d5c101b47c63b5 (diff) | |
[ADD] mail_message_subtype files added in mail
bzr revid: fka@tinyerp.com-20120730070329-0iyb0r1908a8y86r
| -rw-r--r-- | addons/mail/mail_message_subtype.py | 41 | ||||
| -rw-r--r-- | addons/mail/mail_message_subtype.xml | 56 |
2 files changed, 97 insertions, 0 deletions
diff --git a/addons/mail/mail_message_subtype.py b/addons/mail/mail_message_subtype.py new file mode 100644 index 00000000000..0a167a0f1d9 --- /dev/null +++ b/addons/mail/mail_message_subtype.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2009-today OpenERP SA (<http://www.openerp.com>) +# +# 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/> +# +############################################################################## + +from osv import osv +from osv import fields + +class mail_message_subtype(osv.osv): + + _name = 'mail.message.subtype' + _description = 'mail_message_subtype' + _columns = { + 'name': fields.char(' Message Subtype ', size = 128, + required = True, select = 1, + help = 'Subtype Of Message'), + 'model_ids': fields.many2many('ir.model', + 'mail_message_subtyp_message_rel', + 'message_subtype_id', 'model_id', 'Model', + help = "link some subtypes to several models, for projet/task"), + 'default': fields.boolean('Default', help = "When subscribing to the document, users will receive by default messages related to this subtype unless they uncheck this subtype"), + } + _defaults = { + 'default': True, + } diff --git a/addons/mail/mail_message_subtype.xml b/addons/mail/mail_message_subtype.xml new file mode 100644 index 00000000000..8de3224470f --- /dev/null +++ b/addons/mail/mail_message_subtype.xml @@ -0,0 +1,56 @@ +<?xml version="1.0"?> +<openerp> + <data> + + <!-- + SUBTYPES + !--> + + <record model="ir.ui.view" id="view_message_subtype_tree"> + <field name="name">mail.message.subtype.tree</field> + <field name="model">mail.message.subtype</field> + <field name="type">tree</field> + <field name="priority">10</field> + <field name="arch" type="xml"> + <tree string="Subtype"> + <field name="name"/> + <field name="model_ids" invisible="1"/> + <field name="default"/> + </tree> + </field> + </record> + + <record model="ir.ui.view" id="view_mail_message_subtype_form"> + <field name="name">mail.message.subtype.form</field> + <field name="model">mail.message.subtype</field> + <field name="type">form</field> + <field name="arch" type="xml"> + <form string="Email message" version="7.0"> + <sheet> + <group> + <group> + <field name="name"/> + </group> + <group> + <field name="default"/> + </group> + </group> + <separator string="Models"/> + <field name="model_ids" widget="many2many"/> + </sheet> + </form> + </field> + </record> + + <record id="action_view_message_subtype" model="ir.actions.act_window"> + <field name="name">Subtypes</field> + <field name="res_model">mail.message.subtype</field> + <field name="view_type">form</field> + <field name="view_mode">tree,form</field> + </record> + + <menuitem name="Subtypes" id="menu_message_subtype" parent="base.menu_email" + action="action_view_message_subtype"/> + + </data> +</openerp> |
