Skip to main content
iVentureTeam

google_address_autocomplete

This widget turns a street field into a Google Places search that fills the whole address block. Its seven field-mapping options are what make it usable on a model that does not name its fields the way res.partner does.

September 18, 2026Updated September 18, 20265 min read
Technical namegoogle_address_autocomplete
Field typeschar
Viewsform
Modulegoogle_address_autocomplete, an optional module that needs a Google Places key
Used in core0 uses in Odoo 19 Community or Enterprise. It is applied by the module's own configuration rather than by a standard view.
VersionsOdoo 19.0, Odoo 20.0
No-code setupNo. The module is configured in Settings, but the widget itself has no Studio entry.
Alternativesfield_partner_autocomplete, char

What the google_address_autocomplete widget does

The widget extends the standard char field and replaces its input with an autocomplete backed by Google Places. Picking a suggestion calls back for the full address detail, then writes every part of it onto the record in one update.

Seven address parts are handled: street, street2, city, state_id, zip, country_id and city_id. Each is exposed as an option so you can name the field it writes to, which is what lets the widget work on a model that is not res.partner.

Many2one parts are written as proper record references rather than text. The code checks the field type and builds { id, display_name } when the target is a many2one, so country and state land as real links.

What this means for your team

Address typos are the quiet tax on any Odoo database that ships things or invoices across borders. This widget removes most of them by making the address come from Google rather than from a keyboard.

There are two costs to weigh. It sends what the user types to Google, which matters if your addresses are sensitive or your organization has data-residency commitments. And it needs an API key, which means a bill that scales with use and an account someone has to own.

For a sales or delivery team entering addresses all day, it pays for itself. For a model where addresses are typed twice a month, it usually does not.

Supported options in Odoo 19

Seven field-mapping options, plus everything the standard char widget supports. Each mapping option takes the name of the field on your model that should receive that part of the address. Leave one out and the widget writes to a field of the same name as the option, which is why it works on res.partner with no configuration at all.

OptionTypeWhat it does
streetfield nameField that receives the street line. Must be a char field and must be present in the view.(default: street)
street2field nameField for the additional street line. Char field.(default: street2)
cityfield nameField for the city name. Char field.(default: city)
state_idfield nameField for the state or province. Accepts char or many2one; a many2one receives a real record reference rather than text.(default: state_id)
zipfield nameField for the postal code. Char field.(default: zip)
country_idfield nameField for the country. Accepts char or many2one; a many2one receives a real record reference.(default: country_id)
city_idfield nameField for a city record, used by localizations that store cities as their own model. Many2one only.(default: city_id)

Two behaviors that are not in any option list. First, the widget only writes to fields present in the view's active fields, so a mapping that points at a field you forgot to place is skipped without a warning. Second, any address part it could not place is joined with spaces and written into the widget's own field, so a partial mapping produces a cluttered street line rather than lost data.

Working examples

On res.partner, where the field names already match, no options are needed:

<field name="street" widget="google_address_autocomplete"/>

On a model with its own naming, map each part and make sure every mapped field is in the view:

<field name="delivery_street" widget="google_address_autocomplete"
       options="{'street': 'delivery_street', 'city': 'delivery_city',
                 'zip': 'delivery_zip', 'country_id': 'delivery_country_id'}"/>
<field name="delivery_city"/>
<field name="delivery_zip"/>
<field name="delivery_country_id"/>

Why a mapped field sometimes never gets filled

The update loop checks the view before it writes:

const recordFieldName = addressFieldMap[fieldName] || fieldName;
if (recordFieldName in activeFields) {
    ...
    valuesToUpdate[recordFieldName] = value || false;
} else if (!(recordFieldName in fields) && value) {
    ...
}

activeFields is what the view actually loaded. A field that exists on the model but is not placed in the form is not in that set, so the widget skips it. No error, no console warning, no partial save. The user picks an address, most of it lands, and one box stays empty.

This is the single most common complaint about this widget, and the fix is always the same: put the field in the view. It can carry invisible="1" if users should not see it. It just has to be loaded.

The second half of that branch explains a stranger symptom. Address parts that correspond to no field at all are collected and, at the end, joined into the widget's own field:

if (!(this.props.name in valuesToUpdate) && rest.length) {
    valuesToUpdate[this.props.name] = rest.join(" ");
}

So a half-configured widget does not silently lose the city and the zip. It stuffs them into the street line. If your street field keeps filling with a whole address run together, that is this branch firing, and it means your mapping is incomplete rather than wrong.

Version compatibility

VersionStatusNotes
Odoo 19.0VerifiedVerified against the shipped 19.0 source.
Odoo 20.0VerifiedVerified against the 20.0 branch. No changes.

Unchanged between the two branches we checked.

What is changing in Odoo 20

No change. Diffing the registration between the 19.0 and 20.0 branches shows no options added or removed and no change to the supported type.

The seven mapping options are generated from a single table in the source rather than written out one by one, so they move together if Odoo ever adds an eighth address part.

Common problems and fixes

SymptomCause and fix
One address field never gets filledThe mapped field is not in the view, so it is not in activeFields and the widget skips it. Add the field to the form. invisible="1" is fine; it only needs to be loaded.
The street line fills with the entire address run togetherAddress parts with nowhere to go are joined and written into the widget's own field. Complete the mapping so every part has a destination field in the view.
Nothing happens as the user typesSearch only fires above five characters. Type more of the address. This is a deliberate threshold, not a fault.
No suggestions at allNo Google Places key configured, or the module is not installed. Configure the key in Settings and confirm google_address_autocomplete is installed.

Google_address_autocomplete widget vs the alternatives

WidgetBest forKey difference
google_address_autocompleteFilling a whole address block from a Google Places searchMaps seven address parts onto your own field names, but only writes fields present in the view
field_partner_autocompleteFilling a company record from a nameSearches companies in Odoo's enrichment service, not addresses in Google
charA manually typed addressNo lookup, no API key and no cost

If you cannot use Google, the field_partner_autocomplete widget fills an address too, but by looking up a company in Odoo's own enrichment service rather than searching an address. It is the better fit when the user knows the company name and not the address, and it costs enrichment credits rather than Google API calls.

Frequently asked questions

Why does one address field stay empty after selecting a Google suggestion?+
Because that field is not in the view. The widget only writes to fields present in the view's active fields, and skips the rest without warning. Add the field to the form, with invisible="1" if needed.
Can I use Odoo's Google address autocomplete on a model other than res.partner?+
Yes. Each of the seven address parts has an option taking the field name on your model, for example options="{'city': 'delivery_city'}". Every mapped field must also be placed in the view.
How many characters before Odoo searches Google for an address?+
More than five. The widget checks request.length > 5 before calling the API, so shorter entries never generate a request or a charge.
Why is my street field filling with the whole address?+
Address parts that have no destination field are joined with spaces and written into the widget's own field. That means the mapping is incomplete: give each part a field that is present in the view.

Addresses arriving wrong from every channel?

Autocomplete fixes the form, not the imports, the portal or the integration that also create partners. We standardize address capture across every route into your database, so shipping and tax stop arguing with each other.

Talk to an Odoo consultant

How this page was produced

Verified by reading addons/google_address_autocomplete/static/src/address_autocomplete/google_address_autocomplete.js on the 19.0 branch of a local clone of the official Odoo repository. The option list is generated in the source from the standardAddressFields table, which is reproduced faithfully in the table above. The active-fields check and the leftover concatenation are quoted from selectAddressProposition. The five-character threshold is read from the sources getter. The registration was diffed against the 20.0 branch. Corrections welcome via our contact page.