summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorajay javiya (OpenERP) <aja@tinyerp.com>2012-06-21 16:20:53 +0530
committerajay javiya (OpenERP) <aja@tinyerp.com>2012-06-21 16:20:53 +0530
commit9cc7d77b08047ff988a00b4d599afca3aae4bdf8 (patch)
tree65a3ccf1d78d80737ef339708f75344e9aa854f8
parente12390e51d6bdb9726edd8b85b52725fd101b6f5 (diff)
[Add]: Add Mail alias wizard
bzr revid: aja@tinyerp.com-20120621105053-5dxlbq48yczdl5ca
-rw-r--r--addons/mail/__openerp__.py2
-rw-r--r--addons/mail/mail_alias_data.xml9
-rw-r--r--addons/mail/wizard/__init__.py2
-rw-r--r--addons/mail/wizard/update_mail_alias.py36
-rw-r--r--addons/mail/wizard/update_mail_alias_wizard.xml34
5 files changed, 82 insertions, 1 deletions
diff --git a/addons/mail/__openerp__.py b/addons/mail/__openerp__.py
index 39413a80bed..4b73994b65d 100644
--- a/addons/mail/__openerp__.py
+++ b/addons/mail/__openerp__.py
@@ -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',
diff --git a/addons/mail/mail_alias_data.xml b/addons/mail/mail_alias_data.xml
new file mode 100644
index 00000000000..041c1dd3316
--- /dev/null
+++ b/addons/mail/mail_alias_data.xml
@@ -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>
diff --git a/addons/mail/wizard/__init__.py b/addons/mail/wizard/__init__.py
index 88b9581f68e..bf35381fc94 100644
--- a/addons/mail/wizard/__init__.py
+++ b/addons/mail/wizard/__init__.py
@@ -20,5 +20,5 @@
##############################################################################
import mail_compose_message
-
+import update_mail_alias
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/mail/wizard/update_mail_alias.py b/addons/mail/wizard/update_mail_alias.py
new file mode 100644
index 00000000000..b419050d48c
--- /dev/null
+++ b/addons/mail/wizard/update_mail_alias.py
@@ -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'}
diff --git a/addons/mail/wizard/update_mail_alias_wizard.xml b/addons/mail/wizard/update_mail_alias_wizard.xml
new file mode 100644
index 00000000000..5cc5162556d
--- /dev/null
+++ b/addons/mail/wizard/update_mail_alias_wizard.xml
@@ -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>