[REV] [IMP] mail: mail.catchall.alias is now only a system parameter; removed from configuration (because much too technical) + udpated tests that could crash on an existing instance.

bzr revid: tde@openerp.com-20130517131109-aosyv23p7rz5sjg5
This commit is contained in:
Thibault Delavallée 2013-05-17 15:11:09 +02:00
parent 1cfd02f66d
commit f3f2d72e04
4 changed files with 8 additions and 21 deletions

View File

@ -40,6 +40,12 @@
<field name="args">()</field>
</record>
<!-- Catchall Email Alias -->
<record id="icp_mail_catchall_alias" model="ir.config_parameter">
<field name="key">mail.catchall.alias</field>
<field name="value">catchall</field>
</record>
<!-- Discussion subtype for messaging / Chatter -->
<record id="mt_comment" model="mail.message.subtype">
<field name="name">Discussions</field>

View File

@ -31,11 +31,6 @@ class project_configuration(osv.TransientModel):
'alias_domain': fields.char('Alias Domain',
help="If you have setup a catch-all email domain redirected to "
"the OpenERP server, enter the domain name here."),
'alias_catchall': fields.char('Catchall Email Alias',
help="Define the default email that will be used as reply_to address "
"with the mailgateway to handle replies to the document "
"discussions not having their specific email alias defined. "
"Only the left part is required.")
}
def get_default_alias_domain(self, cr, uid, ids, context=None):
@ -52,14 +47,3 @@ class project_configuration(osv.TransientModel):
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)
def get_default_alias_catchall(self, cr, uid, ids, context=None):
alias_catchall = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.alias", context=context)
if not alias_catchall:
return {}
return {'alias_catchall': alias_catchall}
def set_alias_catchall(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.alias", record.alias_catchall or '', context=context)

View File

@ -11,10 +11,6 @@
<label for="alias_domain" class="oe_inline"/>
<field name="alias_domain" placeholder="mycompany.my.openerp.com" class="oe_inline"/>
</div>
<div>
<label for="alias_catchall" class="oe_inline"/>
<field name="alias_catchall" placeholder="mailgateway" class="oe_inline"/>
</div>
</xpath>
</field>
</record>

View File

@ -179,7 +179,8 @@ class TestMailgateway(TestMailBase):
'mail_mail: reply_to should equal to mail_message.email_from when having no document or default alias')
# Data: set catchall domain
self.registry('ir.config_parameter').set_param(self.cr, self.uid, 'mail.catchall.domain', 'schlouby.fr')
self.registry('ir.config_parameter').set_param(cr, uid, 'mail.catchall.domain', 'schlouby.fr')
self.registry('ir.config_parameter').unlink(cr, uid, self.registry('ir.config_parameter').search(cr, uid, [('key', '=', 'mail.catchall.alias')]))
# Do: create a mail_mail based on the previous mail_message
mail_id = self.mail_mail.create(cr, uid, {'mail_message_id': msg_id, 'state': 'cancel'})