diff --git a/auth_brute_force/README.rst b/auth_brute_force/README.rst
index 542864e53..79fdafa1f 100644
--- a/auth_brute_force/README.rst
+++ b/auth_brute_force/README.rst
@@ -28,7 +28,7 @@ of the user can be wrong, and mainly in the following cases:
* if the Odoo server is behind an Apache / NGinx proxy without redirection,
all the request will be have the value '127.0.0.1' for the REMOTE_ADDR key;
* If some users are behind the same Internet Service Provider, if a user is
- banned, all the other users will be banned to;
+ banned, all the other users will be banned too;
Configuration
-------------
diff --git a/auth_brute_force/models/res_banned_remote.py b/auth_brute_force/models/res_banned_remote.py
index 3fd28ecc5..661dfc8a5 100644
--- a/auth_brute_force/models/res_banned_remote.py
+++ b/auth_brute_force/models/res_banned_remote.py
@@ -24,11 +24,11 @@ import urllib
import json
from openerp import models, fields, api
-from openerp.tools.translate import _
class ResBannedRemote(models.Model):
_name = 'res.banned.remote'
+ _rec_name = 'remote'
_GEOLOCALISATION_URL = "http://ip-api.com/json/{}"
@@ -37,13 +37,8 @@ class ResBannedRemote(models.Model):
return fields.Datetime.now()
# Column Section
- name = fields.Char(
- string='Name', compute='_compute_remote_description',
- store=True, multi='remote_description', required=True)
-
description = fields.Text(
- string='Description', compute='_compute_remote_description',
- store=True, multi='remote_description')
+ string='Description', compute='_compute_description', store=True)
ban_date = fields.Datetime(
string='Ban Date', required=True, default=_default_ban_date)
@@ -61,20 +56,13 @@ class ResBannedRemote(models.Model):
# Compute Section
@api.multi
@api.depends('remote')
- def _compute_remote_description(self):
+ def _compute_description(self):
for item in self:
url = self._GEOLOCALISATION_URL.format(item.remote)
res = json.loads(urllib.urlopen(url).read())
item.description = ''
for k, v in res.iteritems():
item.description += '%s : %s\n' % (k, v)
- if res.get('status', False) == 'success':
- item.name = _("%s %s - %s %s (ISP: %s)" % (
- res.get('country', ''), res.get('regionName', ''),
- res.get('zip', ''), res.get('city'),
- res.get('isp', '')))
- else:
- item.name = _('Unidentified Call from %s' % (item.remote))
@api.multi
def _compute_attempt_ids(self):
diff --git a/auth_brute_force/views/view.xml b/auth_brute_force/views/view.xml
index 4e11b9a6b..2c3ef7938 100644
--- a/auth_brute_force/views/view.xml
+++ b/auth_brute_force/views/view.xml
@@ -51,9 +51,8 @@