Odoo class differences

When creating a class, sometimes use osv.osv, we also use models.Model What is the main difference between the two? Are there any advantages over others?

+4
source share
2 answers

Before version 7

osv - the class and class of the OpenERP descriptor, and the entire class (model) must inherit it to deploy the OpenERP module.

osv a class inside the OSV module on the OpenERP server that contains all the OpenERP properties, such as you see _column, _defaults and many other things like nameetc, so we must inherit our openerp model (class)

In version 7

ORM, short for Object-Relational Mapping, is a central part of OpenERP.

OpenERP Python. ORM - - - Python (PostgreSQL), , .

osv.osv orm.Model , - . models.Model.

8+

osv.osv --- > orm.Model --- > models.Model

osv.TransientModel --- > orm.TransientModel --- > models.TransientModel

+9

API osv.osv. . - , .

API models.Model.

+5

Source: https://habr.com/ru/post/1584950/


All Articles