[ADD]: mail_gateway: Added thread and message objects+views in mailgateway

bzr revid: rpa@tinyerp.com-20100429134919-4fg6bfwa40tka7lb
This commit is contained in:
rpa (Open ERP) 2010-04-29 19:19:19 +05:30
parent f7e79ce200
commit 695a773eba
4 changed files with 206 additions and 1 deletions

View File

@ -19,5 +19,7 @@
#
##############################################################################
import mail_gateway
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -35,7 +35,7 @@
'depends': ['smtpclient'],
'init_xml': [],
'update_xml': [
"mail_gateway_view.xml"
],
'demo_xml': [],
'installable': True,

View File

@ -0,0 +1,72 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>)
#
# 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, fields
from osv import osv
from osv import fields
from osv import osv
from osv import fields
class mailgate_thread(osv.osv):
'''
Mailgateway Thread
'''
_name = 'mailgate.thread'
_description = 'Mailgateway Thread'
_columns = {
'name':fields.char('Name', size=64),
'message_ids':fields.one2many('mailgate.message', 'thread_id', 'Message'),
}
mailgate_thread()
class mailgate_message(osv.osv):
'''
Mailgateway Message
'''
_name = 'mailgate.message'
_description = 'Mailgateway Message'
_columns = {
'name':fields.char('Message', size=64, required=True),
'thread_id':fields.many2one('mailgate.thread', 'Thread'),
'date': fields.datetime('Date'),
'model_id': fields.many2one('ir.model', "Model"),
'res_id': fields.integer('Resource ID'),
'user_id': fields.many2one('res.users', 'User Responsible', readonly=True),
'message': fields.text('Description'),
'email_from': fields.char('Email From', size=84),
'email_to': fields.char('Email To', size=84),
'email_cc': fields.char('Email From', size=84),
'email_bcc': fields.char('Email From', size=84),
'message_id': fields.char('Message Id', size=1024, readonly=True, help="Message Id on Email Server.", select=True),
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments'),
}
mailgate_message()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,131 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="view_maligate_message_form">
<field name="name">maligate.message.form</field>
<field name="model">maligate.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="maligate message">
<field name="name" />
<field name="date" />
<field name="model_id" />
<field name="res_id" />
<field name="user_id" />
<field name="message_id" />
<notebook colspan="4">
<page>
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
</group>
</page>
<page>
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" />
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_message_tree">
<field name="name">maligate.message.tree</field>
<field name="model">maligate.message</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Mailgateway Message">
<field name="name" select="1" />
<field name="date" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_thread_form">
<field name="name">mailgate.thread.form</field>
<field name="model">mailgate.thread</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Mailgateway Thread">
<field name="name" select="1"/>
<separator string="Messages" colspan="4"/>
<field name="message_ids" nolabel="1" colspan="4">
<tree string="Mailgateway Message">
<field name="name" select="1" />
<field name="date" />
</tree>
<form string="Maligate Message">
<field name="name" />
<field name="date" />
<field name="model_id" />
<field name="res_id" />
<field name="user_id" />
<field name="message_id" />
<notebook colspan="4">
<page string="Email Details">
<group col="4" colspan="4">
<separator string="Email Details" colspan="4"/>
<field name="email_from" />
<field name="email_to" />
<field name="email_cc" />
<field name="email_bcc" />
</group>
</page>
<page string="Attachments">
<separator string="Attachments" colspan="4"/>
<field name="attachment_ids" nolabel="1" colspan="4" />
</page>
</notebook>
</form>
</field>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_mailgate_thread_tree">
<field name="name">mailgate.thread.tree</field>
<field name="model">mailgate.thread</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Mailgateway Thread">
<field name="name" select="1" />
<field name="message_ids" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_view_mailgate_thread">
<field name="name">Mailgateway Threads</field>
<field name="res_model">mailgate.thread</field>
<field name="view_mode">tree,form</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="view_mailgate_thread_tree"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<record model="ir.actions.act_window.view" id="action_view_mailgate_thread_view2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="view_mailgate_thread_form"/>
<field name="act_window_id" ref="action_view_mailgate_thread"/>
</record>
<menuitem id="menu_crm_configuration" name="Cases"
parent="base.menu_base_config" sequence="0"/>
<menuitem id="menu_mailgate_thread" name="Mailgateway Threads" action="action_view_mailgate_thread"
parent="menu_crm_configuration" />
</data>
</openerp>