Fields and widgets

Fields structure the models of a database. If you think of a model as a table or spreadsheet, fields are the columns and records are the individual rows. Fields also define the type of data that is stored within them. The way in which a field’s data is presented and formatted on the UI is controlled by its widget.

With Studio, it is possible to:

Studio fields vs. property fields

Fields created using Studio are saved as columns in your Odoo database. Property fields, on the other hand, act as pseudo-fields; they are shared by all records that are linked to the same parent record (e.g., for tasks, the project, or for a product, the product category), but they are not saved as columns in your database.

Example

Adding a Deadline field to the form view of a task using Studio makes that field visible in every task in your database. Adding a Special instructions property field to a task makes the field visible in all tasks within the same project (i.e., its parent) while other projects’ tasks remain unaffected.

Field types

Fields can be broadly divided into two categories:

  • Simple fields, which contain basic values, such as text, numbers, files, etc.

  • Relational fields, which are used to link and display the data from records on another model.

AI fields

AI fields are essentially standard Odoo fields with added AI capabilities that allow their values to be generated automatically through prompts.

Simple fields

Note

Non-default widgets, when available, are presented as bullet points or sub-headings.

Text (char)

The Text field is used for short text containing any character. One text line is displayed when filling out the field.

  • Badge: displays the value inside a rounded shape, similar to a tag. The value cannot be edited on the UI, but a default value can be set.

  • Copy to Clipboard: users can copy the value by clicking a button.

  • E-mail: the value becomes a clickable mailto link.

  • Image: displays an image using a URL. The value cannot be edited manually, but a default value can be set.

    Note

    This works differently from selecting the Image field directly, as the image is not stored in Odoo when using a Text field with the Image widget. For example, it can be useful if you want to save disk space.

  • Phone: the value becomes a clickable tel link.

    Tip

    Tick Enable SMS to add an option to send an SMS directly from Odoo next to the field.

  • URL: the value becomes a clickable URL.

Example

Examples of Text fields with different widgets

Multiline Text (text)

The Multiline Text field is used for longer text containing any type of character. Two text lines are displayed on the UI when filling out the field.

  • Copy to Clipboard: users can copy the value by clicking a button.

Example

Examples of Multiline Text fields with different widgets

Integer (integer)

The Integer field is used for all integer numbers (positive, negative, or zero, without a decimal).

  • Percentage Pie: displays the value inside a percentage circle, usually for a computed value. The value cannot be edited on the UI, but a default value can be set.

  • Progress Bar: displays the value next to a percentage bar, usually for a computed value. The field cannot be edited manually, but a default value can be set.

  • Handle: displays a drag handle icon to order records manually in List view.

Example

Examples of Integer fields with different widgets

Decimal (float)

The Decimal field is used for all decimal numbers (positive, negative, or zero, with a decimal).

Note

Decimal numbers are displayed with two decimals after the decimal point on the UI, but they are stored in the database with more precision.

  • Monetary: it is similar to using the Monetary field. It is recommended to use the latter as it offers more functionalities.

  • Percentage: displays a percent character % after the value.

  • Percentage Pie: displays the value inside a percentage circle, usually for a computed value. The field cannot be edited manually, but a default value can be set.

  • Progress Bar: displays the value next to a percentage bar, usually for a computed value. The field cannot be edited manually, but a default value can be set.

  • Time: the value must follow the hh:mm format, with a maximum of 59 minutes.

Example

Examples of Decimal fields with different widgets

Monetary (monetary)

The Monetary field is used for all monetary values.

Note

When you first add a Monetary field, you are prompted to add a Currency field if none exists already on the model. Odoo offers to add the Currency field for you. Once it is added, add the Monetary field again.

Example

Example of a Monetary field along with its Currency field

Html (html)

The Html field is used to add text that can be edited using the Odoo HTML editor.

  • Multiline Text: disables the Odoo HTML editor to allow editing raw HTML.

Example

Examples of Html fields with different widgets

Date (date)

The Date field is used to select a date on a calendar.

  • Remaining Days: the remaining number of days before the selected date is displayed (e.g., In 5 days), based on the current date. This field should be set to Read only.

Example

Examples of Date fields with different widgets

Date & Time (datetime)

The Date & Time field is used to select a date on a calendar and a time on a clock. The user’s current time is automatically used if no time is set.

Tip

As well as general properties, some specific properties are available for Date & Time fields that have the Date & Time or Date Range widget set.

Date Range (daterange)

The Date Range widget is used to display a period of time defined by a start date and an end date in a single line. A date range can have a mandatory start and end date, e.g., for a multi-day event, or allow an optional start or end date, e.g., for a field service intervention or a project task.

Adding a date range requires two fields: a Date & Time field with the Date Range widget set and another field that is selected as the start date or end date. This underlying field can be an existing Date or Date & Time field, or one created specifically for this purpose.

To add a date range:

  1. Identify an existing Date or Date & Time field that can be used as the underlying start/end date field, or add a new one. If the date range:

    • has a mandatory start date and end date, this field can be either the start date or end date; the outcome is the same.

    • allows an optional start or end date, this field is the start date or end date, respectively.

    Tip

    To avoid displaying the same information twice, the underlying start/end date field can be made invisible by enabling Invisible or removed from the view by clicking Remove from view.

  2. Add a Date & Time field and set the Widget field to Date Range.

  3. Enter an appropriate Label.

  4. Select the underlying start/end date field from the Start date field or End date field dropdown, as relevant.

  5. If the date range should have a mandatory start and end date, enable Always range.

  6. Update any other general properties or specific properties for Date & Time fields as needed, then click Close in the upper right corner of the screen.

Example

Examples of Date & Time fields with different widgets
Remaining Days (remaining_days)

The Remaining Days widget displays the remaining number of days before the selected date (e.g., In 5 days), based on the current date and time. This field should be set to Read only.

Checkbox (boolean)

The Checkbox field is used when a value should only be true or false, indicated by checking or unchecking a checkbox.

  • Button: displays a radio button. The widget works without switching to the edit mode.

  • Toggle: displays a toggle button. The widget works without switching to the edit mode.

Example

Examples of Checkbox fields with different widgets

Selection (selection)

The Selection field is used when users should select a single value from a group of predefined values.

  • Badge: displays the value inside a rounded shape, similar to a tag. The value cannot be edited on the UI, but a default value can be set.

  • Badges: displays all selectable values simultaneously inside rectangular shapes, organized horizontally.

  • Priority: displays star symbols instead of values, which can be used to indicate an importance or satisfaction level, for example. This has the same effect as selecting the Priority field, although, for the latter, four priority values are already predefined.

  • Radio: displays all selectable values at the same time as radio buttons.

    Tip

    By default, radio buttons are organized vertically. Enable Display horizontally to switch the way they are displayed.

  • Status Bar: displays all selectable values at the same time as an arrow progress bar.

    Tip

    By default, values on the status bar are selectable. Disable Clickable to prevent the value being edited on the UI.

Example

Examples of Selection fields with different widgets

Priority (selection)

The Priority field is used to display a three-star rating system, which can be used to indicate importance or satisfaction level. This field type is a Selection field with the Priority widget selected by default and four priority values predefined. Consequently, the Badge, Badges, Radio, and Selection widgets have the same effects as described under Selection.

Tip

To change the number of available stars by adding or removing values, click Edit Values. Note that the first value is equal to 0 stars (i.e., when no selection is made), so having four values results in a three-star rating system, for example.

Example

Example of a Priority field

File (binary)

The File field is used to upload any type of file, or sign a form (Sign widget).

  • Image: users can upload an image file, which is then displayed in Form view. This has the same effect as using the Image field.

  • PDF Viewer: users can upload a PDF file, which can be then browsed from the Form view.

  • Sign: users can electronically sign the form. This has the same effect as selecting the Sign field.

Example

Examples of File fields with different widgets

Image (binary)

The Image field is used to upload an image and display it in Form view. This field type is a File field with the Image widget selected by default. Consequently, the File, PDF Viewer, and Sign widgets have the same effects as described under File.

Tip

To change the display size of uploaded images, select Small, Medium, or Large under the Size option.

Sign (binary)

The Sign field is used to sign the form electronically. This field type is a File field with the Sign widget selected by default. Consequently, the File, Image, and PDF Viewer widgets have the same effects as described under File.

Tip

To give users the Auto option when having to draw their signature, select one of the available Auto-complete with fields (Text, Many2One, and Related Field on the model only). The signature is automatically generated using the data from the selected field.

Relational fields

Note

Non-default widgets, when available, are presented as bullet points or sub-headings.

Many2One (many2one)

The Many2One field is used to link another record (from another model) to the record being edited. The record’s name from the other model is then displayed on the record being edited.

Example

On the Sales Order model, the Customer field is a Many2One field pointing at the Contact model. This allows many sales orders to be linked to one contact (customer).

Diagram showing a many2one relationship

Tip

  • To prevent users from creating a new record in the linked model, tick Disable creation.

  • To prevent users from opening records in a pop-up window, tick Disable opening.

  • To help users only select the right record, click on Domain to create a filter.

  • To only trigger the search for a linked record after a minimum number of characters has been entered, enter the desired number in the Typeahead search field. In situations where the data set is large, this can enhance both search relevancy and performance.

  • Badge: displays the value inside a rounded shape, similar to a tag. The value cannot be edited on the UI.

  • Radio: displays all selectable values at the same time as radio buttons.

One2Many (one2many)

The One2Many field is used to display the existing relations between a record on the current model and multiple records from another model.

Example

You could add a One2Many field on the Contact model to look at one customer’s many sales orders.

Diagram showing a one2many relationship

Note

To use a One2Many field, the two models must have been linked already using a Many2One field. One2Many relations do not exist independently: a reverse-search of existing Many2One relations is performed.

Lines (one2many)

The Lines field is used to create a table with rows and columns (e.g., the lines of products on a sales order).

Tip

To modify the columns, click on the Lines field and then Edit List View. To edit the form that pops up when a user clicks on Add a line, click on Edit Form View instead.

Example

Example of a Lines field

Many2Many (many2many)

The Many2Many field is used to link multiple records from another model to multiple records on the current model. Many2Many fields can use Disable creation, Disable opening, Domain, just like Many2One fields.

Example

On the Task model, the Assignees field is a Many2Many field pointing at the Contact model. This allows a single user to be assigned to many tasks and many users to be assigned to a single task.

Diagram showing many2many relationships

Tip

To only trigger the search for the linked record after a minimum number of characters has been entered, enter the desired number in the Typeahead search field. In situations where the data set is large, this can enhance both search relevancy and performance.

  • Checkboxes: users can select several values using checkboxes.

  • Tags: users can select several values appearing in rounded shapes, also known as tags. This has the same effect as selecting the Tags field.

Tags (many2many)

The Tags field is used to display several values from another model appearing in rounded shapes, also known as tags. This field type is a Many2Many field with the Tags widget selected by default. Consequently, the Checkboxes and Many2Many widgets have the same effects as described under Many2Many.

Tip

To display tags with different background colors, tick Use colors.

Example

Example of a Tags field

Add a field to a view

With Studio, it is possible to add:

Tip

Add a new field to a form or list view to save it to the model and make it available as an existing field in other views of the same model.

Add a new field

Tip

Activate developer mode before adding a new field to see, and be able to edit, the field’s technical name during configuration.

To add a new field, follow these steps:

  1. Navigate to the relevant form or list view, then click the (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the (Toggle Studio) icon, then navigate to the relevant form or list view.

  2. In the Add tab, drag the relevant field type from the New Fields section and drop it in the desired position. If the new field is a relational field, select the relevant reciprocal field, model, or related field in the pop-up.

  3. In the Properties tab, configure the field’s properties:

    • Enter the Label to be displayed as the field name on the UI; this is also used to generate the default technical name of the field.

    • Click anywhere outside the Label field to see the Technical Name updated with the default technical name.

      Note

      • The Technical Name of a new field can be edited in Studio during the configuration process. At any other time, a field’s technical name can only be modified via the technical settings of the database.

      • The technical name of a new field added using Studio is by default prefixed by x_studio_.

    • Optionally, select a different Widget via the dropdown; the default widget for the field type is selected by default.

    • Optionally, configure any other field properties.

  4. Click Close in the top-right corner to close Studio.

Add an existing field

To add a field that exists on the model but that is not present on the current view, follow these steps:

  1. Navigate to the relevant view, then click the (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the (Toggle Studio) icon, then navigate to the relevant view.

  2. In the Add tab, in the left panel, click Existing Fields to reveal a list of all the model’s fields that are not currently present in the view.

  3. Drag the relevant field and drop it in the desired position.

  4. In the Properties tab, configure the relevant properties for the field in the current view.

    Note

    Various properties can be configured independently for different views, if needed, such as the Label, the Widget, the visibility of the field for certain user groups, as well as whether or not the field is Invisible, Required, or Readonly.

  5. Click Close in the top-right corner to close Studio.

Field properties

A series of general properties can be configured for most combinations of field type and widget. Additional properties are available depending on the specific field type and widget selected. For example, Date & Time fields using the Date & Time or Date Range widget have various specific properties that can be configured.

General properties

  • Class: Use Bootstrap or other custom classes defined in Odoo to customize how the field is styled and displayed on the UI.

  • Invisible: Enable this property when it is not necessary for users to view a field on the UI. This helps declutter the UI by only showing the essential fields depending on a specific situation.

  • Required: Enable this property if a field should always be completed by the user before being able to proceed.

  • Readonly: Enable this property if users should not be able to modify a field.

Tip

  • The Invisible property also applies inside Studio. To view hidden fields in Studio, click on a view’s View tab and enable Show Invisible Elements.

  • The Invisible, Required, and Readonly properties can be enabled for specific records only by clicking on Conditional and creating a filter.

    Example

    On the form view of the Contact model, the Title field only appears when Individual is selected, as that field would not be helpful for a Company contact.

  • Label: This is the field name on the UI; the label is used to generate the technical name of the field.

  • Help Tooltip: To explain the purpose of a field, add a description. The text is displayed inside a tooltip box when hovering with your mouse over the question mark beside the field’s label.

  • Technical Name: To view a field’s technical name in Studio (and, during the configuration of a new field, edit it if desired), activate developer mode.

    Tip

    If this field needs to be updated but is no longer editable via Studio, the technical name can be modified via the technical settings of the database.

  • Widget: To change the default appearance or functionality of a field, select one of the available widgets.

  • Placeholder: To provide an example of how a field should be completed, add a fixed placeholder text. The text appears in light gray until a value is entered.

  • Dynamic Placeholder: To provide the value of the selected field as an example of how a field should be completed. The text appears in light gray until a value is entered.

  • Default value: To display a default value in a field when a record is created, add a value.

  • Allow visibility to groups: To limit which users can view the field, select one or more user access groups.

  • Forbid visibility to groups: To prevent certain users from seeing the field, select one or more user access groups.

Properties for Date & Time fields

For Date & Time fields using the Date & Time or Date Range widget, some specific properties are available:

  • Minimal precision: Determine the smallest date unit that must be selected in the date selector. The possible values are Day, Month, Year or Decade. If no value is selected, the user must select a day in the date selector.

  • Maximal precision: Determine the largest date unit that can be used to navigate the date selector. The possible values are Day, Month, Year or Decade. If no value is selected, the user can navigate the date selector by decade.

  • Warning for future dates: Enable this property to display a warning icon if a future date is selected.

  • Date format: By default the date will be shown as Apr 2, 2025, 08:05 AM. Enable this property to show the date in the format 4/2/2025 08:05:00. The numeric mode is the format set on the current language. In this mode the seconds are always shown.

  • Show date: This property is enabled by default for Date & Time fields. Disable this property to show only the time.

  • Show time: This property is enabled by default for Date & Time fields. On a read-only field, disable the property to show only the date. This can keep a list view less cluttered, for example.

  • Show seconds: This property is disabled by default for Date & Time fields. Enable the property to show the seconds.

  • Time interval: Enter a value to determine the minute intervals shown in the time selector. For example, enter 15 to allow quarter-hour intervals. The default value is set to 5 minutes.

  • Earliest accepted date: Enter the earliest date that can be selected in the date selector in ISO-format, i.e., YYYY-MM-DD. If the current date is always the earliest accepted date, enter today. On the date selector, dates prior to the earliest accepted date are grayed out.

  • Latest accepted date: Enter the latest date that can be selected in the date selector in ISO-format, i.e., YYYY-MM-DD. If the current date is always the latest accepted date, enter today. On the date selector, dates later than the latest accepted date are grayed out.

Modify a field’s properties

To modify the properties of a field, follow these steps:

  1. Navigate to the relevant view, then click the (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the (Toggle Studio) icon, then navigate to the relevant view.

  2. Click on the relevant field.

  3. In the Properties tab, make any desired changes to the field properties.

    Tip

    Various properties can be configured independently for different views, such as the Label, the Widget, the visibility of the field for certain user groups, as well as whether or not the field is Invisible, Required, or Readonly.

  4. Click Close in the top-right corner to close Studio.

Note

The Technical Name of a field (visible in Studio with developer mode activated) cannot be modified in Studio; this can be done via the technical settings of the database.

Modify a field’s technical name

To modify the technical name of a field, activate developer mode, then follow these steps:

  1. With the field open in Studio, copy the technical name of the field.

  2. Remove the field from all views in Studio, then click Close to close Studio.

  3. Navigate to Settings app ‣ Technical ‣ Fields.

  4. Paste the copied technical name into the search bar, then open the relevant field.

  5. Modify the Field Name as needed.

Once the field’s technical name has been updated, the field can then be added (back) to the relevant view(s) from the list of existing fields.

Important

When updating the technical name of a field, make sure to keep at least the x_ prefix, which is required for any custom field; for fields created using Studio, keep the x_studio_ prefix to allow such fields to be more easily identified.

Remove a field from a view

To remove a field from a view, follow these steps:

  1. Navigate to the relevant view, then click the (Toggle Studio) icon in the upper-right corner. Alternatively, with any app open, click the (Toggle Studio) icon, then navigate to the relevant view.

  2. Click on the relevant field.

  3. Scroll to the bottom of the Properties tab, then click Remove from view.

  4. Click Ok to confirm the action.

Tip

  • A removed field can be easily added back to the view at a later stage, if needed.

  • If the intention is to declutter the view, it is also possible to modify a field and make it Invisible on the view in question.