Skip to main content
iVentureTeam

field_partner_autocomplete

Type a company name and this widget fills the rest of the partner record from Odoo's enrichment service. It also saves the record and posts a message, which is more than most widgets do.

September 18, 2026Updated September 18, 20264 min read
Technical namefield_partner_autocomplete
Field typeschar
Viewsform
Modulepartner_autocomplete, installed with most business apps
Used in core0 explicit uses in Odoo 19 Community or Enterprise. The module applies it through its own view inheritance.
VersionsOdoo 19.0, Odoo 20.0
No-code setupNo. The service is configured in Settings, but the widget has no Studio entry.
Alternativesgoogle_address_autocomplete, char

What the field_partner_autocomplete widget does

The widget extends the standard char field and adds an autocomplete whose suggestions come from Odoo's partner enrichment service. Selecting one fetches the full company record and writes it onto the form.

It does more than fill fields. On res.partner it saves the record, calls enrich_company_message_post so the chatter records what was enriched, and reloads the record. It then tells the model bus the form is no longer dirty.

Two details worth knowing before you place it. Suggestions are filtered by the record's country_id unless the worldwide path is used, and the logo is written to a different field depending on the model.

What this means for your team

This is the difference between a salesperson typing an address from a business card and picking a company from a list. For a team creating new customers or vendors daily, it removes both the typing and the transcription errors that follow it.

Two things to tell the team. The enrichment service costs credits, so a habit of enriching every record including ones you already have is a real bill. And on a contact record it saves the form for you, so an enrichment cannot be undone by simply discarding the form. If someone picks the wrong company, they are editing a saved record rather than abandoning an unsaved one.

Working examples

On a company name field:

<field name="name" widget="field_partner_autocomplete"/>

For country-scoped results to work, the country field has to be loaded on the form:

<field name="country_id"/>
<field name="name" widget="field_partner_autocomplete"/>

The widget that saves your record

Most field widgets change what you see. This one changes the record's lifecycle, and only on res.partner:

if (this.props.record.resModel === 'res.partner') {
    const saved = await this.props.record.save();
    if (saved && data.isEnrichAccessible) {
        await this.orm.call("res.partner", "enrich_company_message_post",
                            [this.props.record.resId, additionalData]);
        this.props.record.load();
    }
}

this.props.record.model.bus.trigger("FIELD_IS_DIRTY", false);

Three consequences. The record is written to the database at selection time, so Discard no longer reverts the enrichment. The chatter gains a message describing what was enriched, which is useful for audit and surprising if you did not expect it. And the form is marked clean, so a user who navigates away gets no unsaved-changes warning even though the record just changed substantially.

On any other model none of that happens: the fields are filled and the form stays dirty like any normal edit.

The other asymmetry is the logo:

const logoField = this.props.record.resModel === 'res.partner' ? 'image_1920' : 'logo';

If you put this widget on your own model and the logo never appears, the reason is that the widget is looking for a field called logo, not image_1920. Name the field logo and it lands.

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 the same component shape and no options added or removed.

Common problems and fixes

SymptomCause and fix
Discard does not undo an enrichmentOn res.partner the widget saves the record as part of selecting a suggestion. Correct the record and save again. There is nothing to discard because it is already written.
The logo is not filled on a custom modelThe widget writes to image_1920 only on res.partner; on any other model it writes to a field named logo. Name the image field logo, or override the widget.
Suggestions are limited to one countryThe query is scoped by the record's country_id by default. Use the search-worldwide path, which clears the country filter, or clear the country before searching.
No suggestions appearFewer than three characters typed, or the enrichment service is unconfigured or out of credits. Type at least three characters and check the service configuration and credit balance in Settings.

Field_partner_autocomplete widget vs the alternatives

WidgetBest forKey difference
field_partner_autocompleteCreating a company record from just its nameFills the whole record, and on res.partner saves it and posts to the chatter
google_address_autocompleteParsing an address the user already hasSearches addresses in Google Places rather than companies in Odoo's service
charTyping the name manuallyNo lookup, no credits and no automatic save

Compare against google_address_autocomplete, which solves the neighboring problem. Use partner autocomplete when the user knows the company name and wants the whole record; use the Google widget when they know the address and want it parsed correctly. They cost different things: enrichment credits versus Google Places calls.

Frequently asked questions

Does Odoo's partner autocomplete save the record automatically?+
On res.partner, yes. Selecting a suggestion saves the record, posts an enrichment message in the chatter and clears the dirty flag. On any other model it only fills the fields and leaves the form unsaved.
Why is the company logo not filled on my custom model?+
The widget writes the logo to image_1920 only on res.partner. On every other model it writes to a field named logo, so name your image field logo or override the widget.
How many characters trigger the partner autocomplete search?+
More than two. The widget's validateSearchTerm requires a request longer than two characters before it calls the enrichment service.
Why are suggestions limited to one country?+
By default the query is scoped to the record's country_id. The widget has a search-worldwide path that sets the country filter to zero, which removes the restriction.

Duplicate customers piling up?

Enrichment fills records beautifully and creates duplicates just as fast when the same company arrives from sales, the website and an import. We set up matching rules and a dedupe process so enrichment improves your data instead of multiplying it.

Book a free consultation

How this page was produced

Verified by reading addons/partner_autocomplete/static/src/js/partner_autocomplete_fieldchar.js on the 19.0 branch of a local clone of the official Odoo repository. The save, the chatter message, the dirty-flag reset and the logo field switch are quoted from onSelectPartnerAutocompleteOption. The two-character threshold comes from validateSearchTerm, and the country scoping from the sources getter. The registration was diffed against the 20.0 branch. Corrections welcome via our contact page.