[Add]: Add Mail alias wizard

bzr revid: aja@tinyerp.com-20120621105053-5dxlbq48yczdl5ca
This commit is contained in:
ajay javiya (OpenERP) 2012-06-21 16:20:53 +05:30
parent e12390e51d
commit 9cc7d77b08
5 changed files with 82 additions and 1 deletions

View File

@ -56,7 +56,9 @@ The main features are:
'depends': ['base', 'base_tools'],
'data': [
'wizard/mail_compose_message_view.xml',
'wizard/update_mail_alias_wizard.xml',
'mail_message_view.xml',
'mail_alias_data.xml',
'mail_subscription_view.xml',
'mail_thread_view.xml',
'mail_group_view.xml',

View File

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.config_parameter" id="user_mail_alias">
<field name="key">mail.catchall.domain</field>
<field name="value">openerp.my.openerp.com</field>
</record>
</data>
</openerp>

View File

@ -20,5 +20,5 @@
##############################################################################
import mail_compose_message
import update_mail_alias
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,36 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-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 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 General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>
#
##############################################################################
from osv import orm
from osv import fields
class transient_update_maildomain(orm.TransientModel):
_name = "transient.update.maildomain"
_description = "Update Mail Domain"
_columns = {
'name' : fields.text('Domain', required=True),
}
def update_domain(self, cr, uid, ids, context=None):
config_parameter_pool = self.pool.get("ir.config_parameter")
for record in self.browse(cr, uid, ids, context):
config_parameter_pool.set_param(cr, uid, "mail.catchall.domain", record.name, context)
return {'type': 'ir.actions.act_window_close'}

View File

@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.ui.view" id="transient_update_maildomain_form">
<field name="name">transient.update.maildomain.form</field>
<field name="model">transient.update.maildomain</field>
<field name="type">form</field>
<field name="arch" type="xml" >
<form string="Configure Mail Domain" version="7.0">
<header>
<button name="update_domain" string="Configure"
type="object" class="oe_highlight"/>
</header>
<group colspan="4">
<separator string="Email Domain" colspan="4"/>
<field name="name" nolabel="1" colspan="4" placeholder="openerp.my.openerp.com"/>
</group>
</form>
</field>
</record>
<record id="action_transient_update_maildomain_form" model="ir.actions.act_window">
<field name="name">Configure Mail Domain</field>
<field name="res_model">transient.update.maildomain</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<menuitem id="menu_action_transient_update_maildomain"
parent="base.menu_email"
action="action_transient_update_maildomain_form"
sequence="100"/>
</data>
</openerp>