'Send a message to OpenERP\'s publisher warranty server to check the
validity of the contracts, get notifications, etc...
@param cron_mode: If true, catch all exceptions (appropriate for usage in a cron).
@type cron_mode: boolean'

@api.multi
def update_notification(self, cron_mode=True):

    try:
        try:
            result = self._get_sys_logs()
        except Exception:
            if cron_mode:
                return False
            _logger.debug('Exception    while    sending    a    get    logs    messages', exc_info=1)
            raise UserError(_('Error    during    communication    with    the    publisher    warranty    server.'))
        user = self.env['res.users'].sudo().browse(SUPERUSER_ID)
        poster = self.sudo().env.ref('mail.channel_all_employees')
        if (not (poster and poster.exists())):
            if (not user.exists()):
                return True
            poster = user
        for message in result['messages']:
            try:
                poster.message_post(body=message, subtype='mt_comment', partner_ids=[user.partner_id.id])
            except Exception:
                pass
        if result.get('enterprise_info'):
            self.env['ir.config_parameter'].sudo().set_param('database.expiration_date', result['enterprise_info'].get('expiration_date'), ['base.group_user'])
            self.env['ir.config_parameter'].sudo().set_param('database.expiration_reason', result['enterprise_info'].get('expiration_reason', 'trial'), ['base.group_system'])
            self.env['ir.config_parameter'].sudo().set_param('database.enterprise_code', result['enterprise_info'].get('enterprise_code'), ['base.group_user'])
    except Exception:
        if cron_mode:
            return False
        else:
            raise
    return True
