[MERGE] lp:~openerp-commiter/openobject-addons/trunk-mail-alias-jam-config-aja
authorJigar Amin - OpenERP <jam@tinyerp.com>
Thu, 21 Jun 2012 13:06:03 +0000 (18:36 +0530)
committerJigar Amin - OpenERP <jam@tinyerp.com>
Thu, 21 Jun 2012 13:06:03 +0000 (18:36 +0530)
bzr revid: jam@tinyerp.com-20120621130603-ltsxhnm1lpz6rozl

addons/mail/__openerp__.py
addons/mail/mail_alias_data.xml [new file with mode: 0644]
addons/mail/wizard/__init__.py
addons/mail/wizard/update_mail_alias.py [new file with mode: 0644]
addons/mail/wizard/update_mail_alias_wizard.xml [new file with mode: 0644]

index 4436e2b..1dec3bf 100644 (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',
diff --git a/addons/mail/mail_alias_data.xml b/addons/mail/mail_alias_data.xml
new file mode 100644 (file)
index 0000000..041c1dd
--- /dev/null
@@ -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>
index 88b9581..bf35381 100644 (file)
@@ -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 (file)
index 0000000..b419050
--- /dev/null
@@ -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 (file)
index 0000000..40ae80a
--- /dev/null
@@ -0,0 +1,35 @@
+<?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="Update" 
+                            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>