2
Most read
3
Most read
8
Most read
Field Parameters in Odoo 18
Enterprise
Enterprise
Introduction
In this slide we’ll discuss on the field parameters in Odoo 18.
These parameters are essential for customizing and controlling
the behavior of fields in models. We will review some of the most
commonly used parameters and their applications in
development.
Enterprise
1. String
This parameter defines the label that will be displayed in the form
view for the field. If not explicitly defined, Odoo will use the field's
name as the label. Example:
name = fields.Char(string="Name of the field")
2. Required:
Specifies whether the field is mandatory. A user will not be able
to save a record without entering a value for required fields.
Example:
name = fields.Char(string="Name", required=True)
Enterprise
3. Readonly:
Makes the field non-editable in the form view. However, it may still be
altered through code or computed methods. Example:
name = fields.Char(string="Name", readonly=True)
4. Default:
Provides a default value for the field if no value is provided. This can
be a static value or a callable function that computes the default
value based on certain logic. Example:
state = fields.Selection(default='draft')
Enterprise
5. Help:
Adds a tooltip with additional information that is shown when a user
hovers over the field. Example:
name = fields.Char(string="Name", help="Enter the Name")
6. Compute:
Assigns a method that calculates the value of the field. The
method is triggered when the field is accessed or updated.
Example:
total = fields.Float(compute='_compute_total')
Enterprise
7. Store:
Used for computed fields. If set to True, the result of the
computation will be stored in the database, rather than being
recalculated each time the field is accessed. Example:
total = fields.Float(compute='_compute_total', store=True)
8. Copy:
Controls whether the field value should be copied when
duplicating a record. By default, all fields are copied unless
specified otherwise. Example:
sequence = fields.Integer(copy=False)
Enterprise
9. Translate
"Translate" can be set to True to make a field translatable for different
languages. This is useful when you need to present your application
in multiple languages. Example:
name = fields.Char(string="Name", translate=True)
10. Groups:
Restricts the visibility of the field to users in specific groups,
controlling access to sensitive information. Example:
salary = fields.Float(groups="hr.group_hr_manager")
Enterprise
11. Index:
Indicates whether the field should be indexed in the database.
Indexing improves the search speed for the field, especially in
large datasets. Let's explore the different aspects of indexing:
True or "btree": This is the default index type used for many2one
relationships in Odoo. Example:
field_name = fields.Many2one('model.name', index=True)
“btree_not_null": This index type is similar to the "btree" index but
excludes NULL values. It proves particularly valuable when a
significant number of values in the field are NULL or when NULL
values are infrequently searched for. Example:
field_name = fields.Char(index="btree_not_null")
Enterprise
"gin" or "trigram": These index types leverage Generalized Inverted
Indexing (GIN) with trigrams, and they are particularly suitable for
full-text searches. They significantly improve search performance
when dealing with textual data. Example:
field_name = fields.Text(index="gin")
False or None: Setting the "index" attribute to False or None
indicates that no index should be applied to the field. This is the
default behavior in Odoo when the "index" attribute is not
explicitly specified. Example:
field_name = fields.Integer(index=False)
Enterprise
12. Ondelete:
Determines the behavior when a record referenced by a Many2one
field is deleted. Common options are cascade, set null, or restrict.
Example:
partner_id = fields.Many2one('res.partner', ondelete='cascade')
13. Digits:
Used to define precision for fields like Float where exact decimal
places matter. Example:
price = fields.Float(digits=(6, 2))
Enterprise
14. Domain:
Sets conditions that filter which records can be selected in fields like
Many2one or One2many. Example:
partner_id = fields.Many2one('res.partner', domain=[('customer',
'=', True)])
15. Tracking:
Tracks changes to the field's value in the chatter for auditing or
monitoring purposes. Example:
status = fields.Selection(tracking=True)
Enterprise
16. Selection_add
In the case of an overridden field, "Selection_add" extends the
selection list by appending new values to the existing selection in a
specific order.
state = fields.Selection( selection_add=[('approved', 'Approved'),
('rejected', 'Rejected')], )
For More Info.
Check our company website for related blogs
and Odoo book.
Check our YouTube channel for
functional and technical videos in Odoo.
Enterprise
www.cybrosys.com

More Related Content

PPT
Python-review1.ppt
PPT
Python-review1 for begineers to code.ppt
PDF
Python-review1.pdf
PPT
Python-review1.ppt
PPTX
How to use _name_search() method in Odoo 18
PPTX
How to use fields_get method in Odoo 18
PPTX
Difference between write and update in odoo 18
PDF
Data structures and algorithms short note (version 14).pd
Python-review1.ppt
Python-review1 for begineers to code.ppt
Python-review1.pdf
Python-review1.ppt
How to use _name_search() method in Odoo 18
How to use fields_get method in Odoo 18
Difference between write and update in odoo 18
Data structures and algorithms short note (version 14).pd

Similar to Field Parameters in Odoo 18 - Odoo 18 Slides (20)

PDF
C_Program_Yr1[1].pdf for computer science
PPS
Coding Best Practices
PPT
Coding Standards & Best Practices for iOS/C#
PPTX
Sharbani bhattacharya VB Structures
DOC
DOC
2 marks- DS using python
PDF
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
PDF
E-Book 25 Tips and Tricks MS Excel Functions & Formulaes
PPT
DATA STRUCTURE AND APPLICATIONS -MODULE1.PPT
PPTX
C++ tutorial assignment - 23MTS5730.pptx
PPTX
Python_Unit-1_PPT_Data Types.pptx
PPTX
Programming in C sesion 2
PPTX
Array Data StructureData StructureData Structure.pptx
PPTX
What are the Basic Fields in the Odoo 17 ERP
PPTX
Model Attributes in Odoo 18 - Odoo 18 Slides
PDF
vb.net.pdf
ODP
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
PDF
C basic questions&ansrs by shiva kumar kella
PPTX
Automatic and Reserved Fields in Odoo 18
PDF
C Programming - Refresher - Part IV
C_Program_Yr1[1].pdf for computer science
Coding Best Practices
Coding Standards & Best Practices for iOS/C#
Sharbani bhattacharya VB Structures
2 marks- DS using python
Abstract Data Types (a) Explain briefly what is meant by the ter.pdf
E-Book 25 Tips and Tricks MS Excel Functions & Formulaes
DATA STRUCTURE AND APPLICATIONS -MODULE1.PPT
C++ tutorial assignment - 23MTS5730.pptx
Python_Unit-1_PPT_Data Types.pptx
Programming in C sesion 2
Array Data StructureData StructureData Structure.pptx
What are the Basic Fields in the Odoo 17 ERP
Model Attributes in Odoo 18 - Odoo 18 Slides
vb.net.pdf
Android App Development - 11 Lists, grids, adapters, dialogs and toasts
C basic questions&ansrs by shiva kumar kella
Automatic and Reserved Fields in Odoo 18
C Programming - Refresher - Part IV
Ad

More from Celine George (20)

PPTX
How to use get_view() method in Odoo 18
PPTX
Removal Strategy_ FIFO in Odoo 18 Inventory
PPTX
How to Convert Tickets Into Sales Opportunity in Odoo 18
PPTX
How to configure subtask in odoo 18 Project
PPTX
How to Configure Display Product Prices in Odoo 18 Website
PPTX
Managing Customer Rewards_ Gift Cards, Loyalty Programs, and E-Wallets in Odo...
PPTX
How to Manage Coupons in Odoo 18 Sales - Odoo slides
PPTX
What is Next Order Coupons in Odoo 18 Sales
PPTX
How to Manage Buy X Get Y Free in Odoo 18 Sales
PPTX
How to Implement OWL Notification Service in Odoo 18
PPTX
Tracking Profit Margins in Sales Orders with Odoo 18
PPTX
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
PPTX
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
PPTX
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
PPTX
How to Add New Applicants in Odoo 18 Recruitment
PPTX
How to Analyze the Recruitment Process in Odoo 18 Recruitment
PPTX
How to Manage Referral Reporting in Odoo 18 Referrals
PPTX
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
PPTX
Revamp in MTO Odoo 18 Inventory - Odoo Slides
PPTX
How to Manage Starshipit in Odoo 18 - Odoo Slides
How to use get_view() method in Odoo 18
Removal Strategy_ FIFO in Odoo 18 Inventory
How to Convert Tickets Into Sales Opportunity in Odoo 18
How to configure subtask in odoo 18 Project
How to Configure Display Product Prices in Odoo 18 Website
Managing Customer Rewards_ Gift Cards, Loyalty Programs, and E-Wallets in Odo...
How to Manage Coupons in Odoo 18 Sales - Odoo slides
What is Next Order Coupons in Odoo 18 Sales
How to Manage Buy X Get Y Free in Odoo 18 Sales
How to Implement OWL Notification Service in Odoo 18
Tracking Profit Margins in Sales Orders with Odoo 18
How to Configure Outgoing Shipment in 3 Steps Using Odoo 18
How to Configure Outgoing Shipment in 1 Step Using Odoo 18.pptx
How to Configure Outgoing Shipment in 2 Steps Using Odoo 18
How to Add New Applicants in Odoo 18 Recruitment
How to Analyze the Recruitment Process in Odoo 18 Recruitment
How to Manage Referral Reporting in Odoo 18 Referrals
How to Set, Track, & Review Employee Goals in Odoo 18 Appraisals
Revamp in MTO Odoo 18 Inventory - Odoo Slides
How to Manage Starshipit in Odoo 18 - Odoo Slides
Ad

Recently uploaded (20)

PDF
Physical pharmaceutics two in b pharmacy
PPTX
GW4 BioMed Candidate Support Webinar 2025
PDF
Unleashing the Potential of the Cultural and creative industries
PDF
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
PPTX
MMW-CHAPTER-1-final.pptx major Elementary Education
PDF
New_Round_Up_6_SB.pdf download for free, easy to learn
PDF
horaris de grups del curs 2025-2026 de l'institut
PDF
Teacher's Day Quiz 2025
PPTX
MALARIA - educational ppt for students..
PDF
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
PPTX
Juvenile delinquency-Crim Research day 3x
PPTX
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
PPTX
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
PDF
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
PDF
GSA-Past-Papers-2010-2024-2.pdf CSS examination
PDF
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
PDF
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
PPTX
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
PPTX
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
PDF
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf
Physical pharmaceutics two in b pharmacy
GW4 BioMed Candidate Support Webinar 2025
Unleashing the Potential of the Cultural and creative industries
[Medicalstudyzone.com] 1. AIIMS NOV EMBER 2015 SOLVED PAPER.pdf
MMW-CHAPTER-1-final.pptx major Elementary Education
New_Round_Up_6_SB.pdf download for free, easy to learn
horaris de grups del curs 2025-2026 de l'institut
Teacher's Day Quiz 2025
MALARIA - educational ppt for students..
WHAT NURSES SAY_ COMMUNICATION BEHAVIORS ASSOCIATED WITH THE COMP.pdf
Juvenile delinquency-Crim Research day 3x
CHF refers to the condition wherein heart unable to pump a sufficient amount ...
FILIPINO 8 Q2 WEEK 1(DAY 1).power point presentation
Design and Evaluation of a Inonotus obliquus-AgNP-Maltodextrin Delivery Syste...
GSA-Past-Papers-2010-2024-2.pdf CSS examination
CHALLENGES FACED BY TEACHERS WHEN TEACHING LEARNERS WITH DEVELOPMENTAL DISABI...
V02-Session-4-Leadership-Through-Assessment-MLB.pdf
Ppt obs emergecy.pptxydirnbduejguxjjdjidjdbuc
Unit1_Kumod_deeplearning.pptx DEEP LEARNING
LATAM’s Top EdTech Innovators Transforming Learning in 2025.pdf

Field Parameters in Odoo 18 - Odoo 18 Slides

  • 1. Field Parameters in Odoo 18 Enterprise
  • 2. Enterprise Introduction In this slide we’ll discuss on the field parameters in Odoo 18. These parameters are essential for customizing and controlling the behavior of fields in models. We will review some of the most commonly used parameters and their applications in development.
  • 3. Enterprise 1. String This parameter defines the label that will be displayed in the form view for the field. If not explicitly defined, Odoo will use the field's name as the label. Example: name = fields.Char(string="Name of the field") 2. Required: Specifies whether the field is mandatory. A user will not be able to save a record without entering a value for required fields. Example: name = fields.Char(string="Name", required=True)
  • 4. Enterprise 3. Readonly: Makes the field non-editable in the form view. However, it may still be altered through code or computed methods. Example: name = fields.Char(string="Name", readonly=True) 4. Default: Provides a default value for the field if no value is provided. This can be a static value or a callable function that computes the default value based on certain logic. Example: state = fields.Selection(default='draft')
  • 5. Enterprise 5. Help: Adds a tooltip with additional information that is shown when a user hovers over the field. Example: name = fields.Char(string="Name", help="Enter the Name") 6. Compute: Assigns a method that calculates the value of the field. The method is triggered when the field is accessed or updated. Example: total = fields.Float(compute='_compute_total')
  • 6. Enterprise 7. Store: Used for computed fields. If set to True, the result of the computation will be stored in the database, rather than being recalculated each time the field is accessed. Example: total = fields.Float(compute='_compute_total', store=True) 8. Copy: Controls whether the field value should be copied when duplicating a record. By default, all fields are copied unless specified otherwise. Example: sequence = fields.Integer(copy=False)
  • 7. Enterprise 9. Translate "Translate" can be set to True to make a field translatable for different languages. This is useful when you need to present your application in multiple languages. Example: name = fields.Char(string="Name", translate=True) 10. Groups: Restricts the visibility of the field to users in specific groups, controlling access to sensitive information. Example: salary = fields.Float(groups="hr.group_hr_manager")
  • 8. Enterprise 11. Index: Indicates whether the field should be indexed in the database. Indexing improves the search speed for the field, especially in large datasets. Let's explore the different aspects of indexing: True or "btree": This is the default index type used for many2one relationships in Odoo. Example: field_name = fields.Many2one('model.name', index=True) “btree_not_null": This index type is similar to the "btree" index but excludes NULL values. It proves particularly valuable when a significant number of values in the field are NULL or when NULL values are infrequently searched for. Example: field_name = fields.Char(index="btree_not_null")
  • 9. Enterprise "gin" or "trigram": These index types leverage Generalized Inverted Indexing (GIN) with trigrams, and they are particularly suitable for full-text searches. They significantly improve search performance when dealing with textual data. Example: field_name = fields.Text(index="gin") False or None: Setting the "index" attribute to False or None indicates that no index should be applied to the field. This is the default behavior in Odoo when the "index" attribute is not explicitly specified. Example: field_name = fields.Integer(index=False)
  • 10. Enterprise 12. Ondelete: Determines the behavior when a record referenced by a Many2one field is deleted. Common options are cascade, set null, or restrict. Example: partner_id = fields.Many2one('res.partner', ondelete='cascade') 13. Digits: Used to define precision for fields like Float where exact decimal places matter. Example: price = fields.Float(digits=(6, 2))
  • 11. Enterprise 14. Domain: Sets conditions that filter which records can be selected in fields like Many2one or One2many. Example: partner_id = fields.Many2one('res.partner', domain=[('customer', '=', True)]) 15. Tracking: Tracks changes to the field's value in the chatter for auditing or monitoring purposes. Example: status = fields.Selection(tracking=True)
  • 12. Enterprise 16. Selection_add In the case of an overridden field, "Selection_add" extends the selection list by appending new values to the existing selection in a specific order. state = fields.Selection( selection_add=[('approved', 'Approved'), ('rejected', 'Rejected')], )
  • 13. For More Info. Check our company website for related blogs and Odoo book. Check our YouTube channel for functional and technical videos in Odoo. Enterprise www.cybrosys.com