Hello,
what's the difference between models.model and model.BaseModel ?
and where can i find a documentation that explains in details these differences if there is
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
what's the difference between models.model and model.BaseModel ?
and where can i find a documentation that explains in details these differences if there is
Hi,
The BaseModel is the base class for Odoo models. Odoo models are created by inheriting one of the following:1. class:`Model` for regular database-persisted models.
2. class:`TransientModel` for temporary data, stored in the database but
automatically vacuumed every so often.3. class:`AbstractModel` for abstract superclasses meant to be shared by
multiple inheriting models.
The system automatically instantiates every model once per database. Those
instances represent the available models on each database, and depend on
which modules are installed on that database. The actual class of each
instance is built from the Python classes that create and inherit from the
corresponding model.
Every model instance is a "recordset", i.e., an ordered collection of
records of the model. Recordsets are returned by methods like
:meth:`~.browse`, :meth:`~.search`, or field accesses. Records have no
explicit representation: a record is represented as a recordset of one
record.
To create a class that should not be instantiated,
the :attr:`~odoo.models.BaseModel._register` attribute may be set to False.
You can read more about models in this article.
Hope it helps
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up