[IMP] mail: simpler config wizard for catchall domain, merge duplicate demo data files
bzr revid: odo@openerp.com-20120703171130-l8h16xp2dm8ilc6g
This commit is contained in:
parent
f66753362b
commit
0b67a7537e
|
@ -28,6 +28,7 @@ import res_users
|
|||
import res_partner
|
||||
import report
|
||||
import wizard
|
||||
import res_config
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ The main features are:
|
|||
'depends': ['base', 'base_tools'],
|
||||
'data': [
|
||||
'wizard/mail_compose_message_view.xml',
|
||||
'wizard/update_mail_alias_wizard.xml',
|
||||
'res_config_view.xml',
|
||||
'mail_message_view.xml',
|
||||
'mail_alias_data.xml',
|
||||
'mail_subscription_view.xml',
|
||||
|
@ -70,11 +70,10 @@ The main features are:
|
|||
'res_users_view.xml',
|
||||
'mail_alias_view.xml',
|
||||
],
|
||||
'demo_xml': [
|
||||
'user_mail_alias_demo.xml',
|
||||
'demo': [
|
||||
'mail_demo.xml',
|
||||
],
|
||||
'installable': True,
|
||||
'auto_install': False,
|
||||
'certificate': '001056784984222247309',
|
||||
'images': [
|
||||
'images/customer_history.jpeg',
|
||||
|
@ -97,8 +96,5 @@ The main features are:
|
|||
'qweb': [
|
||||
'static/src/xml/mail.xml',
|
||||
],
|
||||
'demo': [
|
||||
'mail_demo.xml',
|
||||
],
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -92,4 +92,19 @@ Check the file in attachment for more information ! (third comment)]]></field>
|
|||
</record>
|
||||
|
||||
</data>
|
||||
|
||||
<data noupdate="1">
|
||||
<record id="mail_alias_demo_user" model="mail.alias">
|
||||
<field name="alias_name">demo</field>
|
||||
<field name="alias_model_id" ref="model_res_users"/>
|
||||
<field name="alias_user_id" ref="base.user_root"/>
|
||||
<field name="alias_force_thread_id" ref="base.user_demo"/>
|
||||
<field name="alias_defaults">{}</field>
|
||||
</record>
|
||||
|
||||
<record model="res.users" id="base.user_demo">
|
||||
<field name="alias_id" ref="mail_alias_demo_user"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -19,18 +19,21 @@
|
|||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import orm
|
||||
from osv import fields
|
||||
from openerp.osv import osv, fields
|
||||
|
||||
class project_configuration(osv.TransientModel):
|
||||
_inherit = 'base.config.settings'
|
||||
|
||||
class transient_update_maildomain(orm.TransientModel):
|
||||
|
||||
_name = "transient.update.maildomain"
|
||||
_description = "Update Mail Domain"
|
||||
_columns = {
|
||||
'name' : fields.text('Domain', required=True),
|
||||
'alias_domain' : fields.char('Catch-all Mail Alias Domain', size=None,
|
||||
help="If you have setup a catch-all mail domain redirected to "
|
||||
"the OpenERP server, enter the domain name here."),
|
||||
}
|
||||
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'}
|
||||
|
||||
def get_default_alias_domain(self, cr, uid, ids, context=None):
|
||||
return {'alias_domain': self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", context=context)}
|
||||
|
||||
def set_alias_domain(self, cr, uid, ids, context=None):
|
||||
config_parameters = self.pool.get("ir.config_parameter")
|
||||
for record in self.browse(cr, uid, ids, context=context):
|
||||
config_parameters.set_param(cr, uid, "mail.catchall.domain", record.alias_domain or '', context=context)
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="view_general_configuration_mail_alias_domain" model="ir.ui.view">
|
||||
<field name="name">base.config.settings.mail.alias</field>
|
||||
<field name="model">base.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.view_general_configuration"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/sheet/group[@string='Others']" position='inside'>
|
||||
<field name="alias_domain" placeholder="mycompany.my.openerp.com"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
|
@ -1,17 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<record id="mail_alias_demo_user" model="mail.alias">
|
||||
<field name="alias_name">demo</field>
|
||||
<field name="alias_model_id" ref="model_res_users"/>
|
||||
<field name="alias_user_id" ref="base.user_root"/>
|
||||
<field name="alias_force_thread_id" ref="base.user_demo"/>
|
||||
<field name="alias_defaults">{}</field>
|
||||
</record>
|
||||
|
||||
<record model="res.users" id="base.user_demo">
|
||||
<field name="alias_id" ref="mail_alias_demo_user"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
|
@ -20,5 +20,5 @@
|
|||
##############################################################################
|
||||
|
||||
import mail_compose_message
|
||||
import update_mail_alias
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,50 +0,0 @@
|
|||
<?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"/>
|
||||
or
|
||||
<button special="cancel" string="Cancel" class="oe_link"/>
|
||||
</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>
|
||||
|
||||
<!-- View for general setting -->>
|
||||
|
||||
<record id="view_general_configuration_mail_domain" model="ir.ui.view">
|
||||
<field name="name">General Settings</field>
|
||||
<field name="model">base.config.settings</field>
|
||||
<field name="inherit_id" ref="base_setup.view_general_configuration"/>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="/form/sheet/group[@string='Others']" position='inside'>
|
||||
<group colspan="4" col="4">
|
||||
<label string="Configure Mail Domain" for="id"/>
|
||||
<button type="action" name="%(action_transient_update_maildomain_form)d" string="Configure" icon="gtk-execute"/>
|
||||
</group>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
Loading…
Reference in New Issue