Geo IP
Instalação
Download both the GeoLite2 City and Country databases. You should end up with two files called GeoLite2-City.mmdb and GeoLite2-Country.mmdb.
Move the files to the folder /usr/share/GeoIP/.
mv ~/Downloads/GeoLite2-City.mmdb /usr/share/GeoIP/ mv ~/Downloads/GeoLite2-Country.mmdb /usr/share/GeoIP/Restart the server
Testar a geolocalização GeoIP no Odoo Site
Edite uma página da web para incluir algumas informações de geo-ip, como o nome do país do endereço IP da solicitação atual. Para isso:
Go to your website. Open the web page that you want to test GeoIP.
Choose .
Add the following piece of XML in the page :
<h1 class="text-center" t-esc="request.geoip.country.name or 'geoip failure'"/>Save and refresh the page.
Se o nome do seu país estiver exibido em negrito no meio da página, o Geo-ip está funcionando.
Se, em vez disso, aparecer "falha de geoip", a geolocalização falhou. As causas comuns são:
The browsing IP address is the localhost (127.0.0.1) or a local area network one. If you don't know, you can access your website using mobile data.
You are using a reverse-proxy (apache, nginx) in front of Odoo but didn't start Odoo with the proxy-mode enabled. See proxy mode <odoo-bin --proxy-mode>.
The GeoIP database is corrupt, missing or unaccessible. In such case a warning was logged in the server logs.