This module adds a new widget to many2one fields that allows to link records without any extra features (no autocomplete and no partial search).
- Preview
auto_awesome What this module does
AI-generated from the code · Odoo 15.0Adds a new 'many2one_simple' widget for many2one fields that links records by exact search instead of autocomplete. Users type a value, press Enter or Tab, and Odoo searches for one matching record.
This module adds a new field widget called 'many2one_simple' that can be applied to any many2one field in Odoo forms. Unlike the standard many2one field, it does not show autocomplete suggestions or partial search results; the user types a value and Odoo looks for exactly one matching record.
When the user leaves the field or presses Enter/Tab, the widget searches the related model using the configured search field and operator. If exactly one record is found, it is linked. If no record is found and creation is allowed, a popup opens to create a new record, optionally pre-filling the search field with the typed value. If creation is not allowed, an error message is shown.
- The widget can be configured with options such as 'search' (field and operator), 'regex' for input validation, 'can_create', 'can_write', and 'no_open'.
- In read-only mode, the linked record is displayed as a clickable link that opens its form view, unless 'no_open' is set.
- An external link button is available in edit mode to open the linked record in a dialog.
The module includes a demo view that applies the widget to the 'industry_id' field on the partner form, searching by exact name. It does not add new models or menus; it only extends the web client's field registry and provides a new widget template.
Depends on
Text generated by AI (DeepSeek) from reading the Odoo 15.0 code on GitHub; it may contain mistakes, so check the code before deciding. View the code on GitHub
Availability by version
Reviewed: 2026-11-03Confirmation status: 3 confirmed, 6 with no information of 9 versions.
Sources · Odoo 15.0
Confirmed on 2026-11-03 in branch 15.0 of OCA/web.
terminal Installation and usage
OCA documentation · Odoo 15.0Configuration
Source · Odoo 15.0Attributes:
* regex [String]: Defines the regex to test the search criteria
* can_create [Boolean]: Allow create new records
* can_write [Boolean]: Allow edit the linked record
Options:- search [Dictionary]
- field: The field to use in the search process [Default is 'id']
- oper: The operator (like, ilike, etc...) [Default is '=']
- no_create: Invalidates the 'can_create' flag
- no_write: Invalidates the 'can_write' flag
- no_open: Disables open the linked record
Usage
Source · Odoo 15.0You need to declare the usage of the new widget as follows: <field name="xxx" widget="many2one_simple" options="...">
If you have a database with demo data, you can test this widget following these instructions:
- Go to Contacts.
- Create or edit a record.
- Set "Industry" field (in Sales & Purchase tab).
- Only if you set the correct industry name ("Administrative" for example), it will be defined. Otherwise, it will try to create one with that name.
Example:
.. code:: xml
<field name="partner_id" widget="many2one_simple" regex="^1\d*" options="{"search": { "field": "name", "oper": "ilike" }}"/
** Only allows search by id's that starts with '1' ...No verified information in OCA: Installation.
Installation instructions, the distribution package, dependencies and configuration steps are not shown because they have not yet been verified in the module documentation for any version.
Data imported from GitHub: this sheet reflects the latest catalog review, not a live lookup. Always check the module documentation and staging before installing in production.