Chapter 3 - Odoo 15 Development Book

Model Attributes

Model attributes are the features of a model that will be defined at the time of creating a new model or using the model that already existed. We can take a look to what are the model attributes in Odoo

_auto = false - Whether we create a new database table that is set to False, override init() to create the database table. Automatically defaults to True for models and Transient models, False for Abstract models.

_log_access - Whether the ORM should automatically generate and update the Access Log Files. Defaults to whatever value was set for _auto.

_table = None - SQL table name used by model if _auto.

_sequence = None - SQL sequence used for ID field.

_sql_constraints = [] - SQL constraints [(name, sql_def, message)].

_register = False - registry visibility at default it is false.

_abstract = True - Whether the model is an abstract model.

_transient = True - whether the model is Transient model.

_name = None - defines the name of the model.

_inherit = () - when we use a model that is already in the database, we use the inherited attribute.

_description = None - The model’s informal name.

_inherits = {} - dictionary {‘parent_model’: ‘m2o_field’} mapping the _name of the parent business objects to the names of the corresponding foreign key fields to use.

_rec_name = None - Field to use for labeling records. At default, it is the name of the record.

_order = ‘id’ - Default order field for searching results.

_check_company_auto = False - On write and create, call _check_company to ensure companies consistency on the relational fields having check_company=True as an attribute.

_parent_name = ‘parent_id’ - The many2one field used as parent field

_parent_store = false - Set to True to compute parent_path field.

_date_name = ‘Date’ - Field to use for default calendar view.

_fold_name = ‘fold’ - Field to determine folded groups in kanban views.



Cybrosys Technologies Pvt. Ltd.
Neospace, Kinfra Techno Park
Kakkancherry, Calicut
Kerala, India - 673635



Cybrosys Technologies Pvt. Ltd.
1st Floor, Thapasya Building,
Infopark, Kakkanad,
Kochi, India - 682030.



Cybrosys Techno Solutions
The Estate, 8th Floor,
Dickenson Road,
Bangalore, India - 560042

Send Us A Message