Fields and widgets

Estimated reading: 2 minutes 57 views

Introduction

Fields structure the models of a database in Odoo. They act like columns in a spreadsheet, storing data in records. Each field has a data type (e.g., text, number, date), and the way data is displayed or interacted with on the user interface is determined by its widget.

Odoo supports:

  • 15 technical field types
  • 20 fields in Studio, including variations with different default widgets

Widgets allow customization of how field data is rendered (e.g., a percentage bar, toggle switch, image display).

Step-by-Step Instructions

 

1.Adding a New Field in Studio:

  1. Enter Studio: Click the Studio icon from the top-right of your screen.
  2. Choose Form or List View: Only these views allow adding new fields.
  3. Drag & Drop a Field: From the sidebar, drag your desired field type into the view.
  4. Configure the Field:
    1. Set label
    2. Choose a widget (e.g., Progress Bar for integers)
    3. Set visibility or access restrictions
  5. Save and Exit Studio

 

2.Adding a Date Range Field:

  1. Create two Date or DateTime fields (for start and end dates).
  2. Add another DateTime field and set its Widget to Date Range.
  3. Link the start and end fields using dropdowns.
  4. Optionally, check Always Range if both dates are required.

Tips

  • New fields can only be added to Form and List views.
  • Use conditional visibility to show fields only under certain conditions.
  • Use default values and placeholders to guide users.
  • Use the Related Field widget to display info from linked models without creating a new relationship.
  • Disable creation/opening in Many2One or Many2Many to control user access.

Key Benefits

  • Customization: Easily adapt views and forms to your business processes.
  • Usability: Widgets improve how users interact with data (e.g., toggles, image uploads, status bars).
  • Efficiency: Default values, tooltips, and conditional logic reduce data entry errors.
  • Visibility Control: Fields can be shown or hidden based on user roles or values.
  • Data Relationships: Use relational fields to link data across models without duplication.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Learn how we helped 100 top brands gain success