Address autocomplete

Odoo integrates with the Google Places API to allow the autocompletion of addresses. As you begin typing an address, the system provides a list of suggested locations, reducing manual errors and saving time.

Address autocomplete on the contact form.

Importante

Es posible que necesite pagarle a Google si usa la API de Google Places.

Google Places API configuration

To use Google for address autocompletion, you must first enable the API and create the required credentials.

Enable the Google Places API

To enable the Google Places API, follow these steps:

  1. Go to the Google Cloud console.

  2. Create or sign in to a Google account.

  3. In the upper-left corner, click Select a project. Then, in the Select a resource pop-up, create a New Project.

    Truco

    If you have already created a project, but want to switch to a different one, click the selected project’s name in the upper-left corner. Then, in the Select a resource pop-up, manually select a project. If the desired project is already selected by default, proceed to the next step.

  4. Open the (Navigation menu) side panel, then go to APIs and services ‣ Enabled APIs and services.

  5. Click Enable APIs and services.

  6. Search for Places API and select it.

    Importante

    Do not enable Places API (New), as it is not yet supported by Odoo.

  7. Click Enable.

  8. Complete the verification process.

Crear credenciales API

Once the project is created and the Places API is enabled, create API credentials. To do so, follow these steps:

  1. Open the (Navigation menu) side panel of the project, then go to APIs and services ‣ Credentials.

  2. Click Create credentials , then select API key.

  3. In the Create API key panel, enter a Name.

  4. In the Select API restrictions dropdown, specify which APIs the key can access if there are several APIs configured in your project. Ensure Places API is selected, then click OK.

  5. Click Create.

Nota

Under Application restrictions, the API key can be restricted to allow requests only from specific websites, IP addresses, or apps.

Importante

Save your API key securely and never share it publicly.

Configuración en Odoo

Once the API key is generated, connect the Odoo database to the Google Places API. To do so:

  1. Go to the Settings app.

  2. Navigate to the Integrations section.

  3. Enable Google Address Autocomplete, then click Save.

  4. Return to the Integrations section, then paste your Google Places API key in the dedicated field.

  5. Click Save.