_inherit = 'base.config.settings'
_columns = {
+ 'fail_counter': fields.integer('Fail Mail', readonly=True),
'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."),
+ "the Odoo server, enter the domain name here."),
}
+ def get_default_fail_counter(self, cr, uid, ids, context=None):
+ previous_date = datetime.datetime.now() - datetime.timedelta(days=30)
+ return {
+ 'fail_counter': self.pool.get('mail.mail').search(cr, uid, [('date', '>=', previous_date.strftime(DEFAULT_SERVER_DATETIME_FORMAT)), ('state', '=', 'exception')], count=True, context=context),
+ }
+
def get_default_alias_domain(self, cr, uid, ids, context=None):
alias_domain = self.pool.get("ir.config_parameter").get_param(cr, uid, "mail.catchall.domain", default=None, context=context)
if alias_domain is None: