Type of fields in odoo

Hello Odooers, Odoogig and Odoo Lovers,

In this Odoo Technical Tutorial, I would like to explain about what type of fields in odoo  in detail with syntax and example.

Basic fields in odoo :

  • Char

  • Text

  • Integer

  • Float

  • Boolean

  • Binary

  • Date

  • Datetime

  • Selection

  1. Char field in odoo : – 
  • When you want to store strings at that time this field is used

  • Its used when you want to limit the length of string

  • you have to specify limit of the string while defining the field

odoo char field Syntax :

Example :


2. Text field in odoo : –

  • It is same as Char Field but you can use strings in it without any limitation
  • such as if you wants to store large string at that time you can use this field
  • user feedback, notes, review these are examples of text field

odoo text field Syntax :

Example :


3. Integer field in odoo : –

  • If you wants to store only integer values, then you can use Integer Field
  • Integer is a whole number without fraction part such as 3 is integer but 3.5 is not integer

odoo Integer field Syntax :

Example:


4. Float field in odoo : –

  • If you want to store numbers with fraction part then you can use Float field
  • Float is a number with fraction part
  • such as 3.5 is float but 3 is not float
  • you can use Float Field where you wish to use Integer Field, but you cant do reverse. So Float Field is mostly used in odoo

odoo float field Syntax :

Example:


5. Boolean field in odoo  ((true, false)): –

  • Boolean simply means, either value of field will be True of False
  • Boolean Field store only True and False
  • its just one type of Flag that determines status of any record
  • for example in employee’s screen if you want to check whether employee has contract or not, at that time you can use Boolean field

odoo Boolean field Syntax :

Example:


6. Binary field in odoo : –

  • If you wants to upload something(file, image etc) and then want to store it in field at that time Binary Field is used
  • It store all kinds of files and images, like .doc, .excel, .png, .jpeg etc
  • when you define that field, it will give you an option to upload your file
  • you just have to click on upload button and one window will pop-up, then select your file and upload it

Odoo Binary field Syntax :

Example:


7.Date  field in odoo : –

  • If you want to store date, at that time Date Field is used
  • This field allows you to select date from one dialog box which looks like little calender
  • Date : 8-10-2018

Odoo Date field Syntax :

Example:


8. Datetime field in odoo : –

  • If you want to store date along with current time, at that time Datetime Field is used
  • This field allows you to select date and time from one dialog box which looks like little calender

Odoo Datetime field Syntax :

Example:


9. Selection field in odoo : –

  • Selection Field allows the user to make a selection from various predefined values
  • If you want multiple selection option then you can use selection field
  • while declaring selection field in .XML file at that time various widget will be used there
  • such as ‘selection’, ‘radio’, ‘statusbar’
  • we will see these 3 in different example

Odoo Selection field Syntax :

Example:

Cheers Odoo !

 


GET IN TOUCH.!

We’d Love to Hear from You! We are happy to answer any questions, you have regarding My Training.

Mail : getodootraining@gmail.com

Skype : mayur_maheshwari1

What’s app : +919924542042

LEAVE A REPLY

Leave a Reply

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