Odoo Help


osv.osv or orm.Model [Closed]

on 2/27/14, 4:33 AM 6,940 views

The Question has been closed

Ray Carnes
on 03/02/2014 23:00:25

From which class should new OpenERP objects inherit - osv.osv or orm.Model? In source code I found that osv.osv is actually an orm.Model class. Excerpt from osv module:

# deprecated - for backward compatibility.
osv = Model
osv_memory = TransientModel
osv_abstract = AbstractModel # ;-)

Is there really any difference in using osv.osv or orm.Model for inheritance in OpenERP objects?


Daniel Reis

--Daniel Reis--
| 7 8 9
Linda-a-Velha, Portugal
--Daniel Reis--

Author of the "Odoo Development Essentials" book.

Applications Manager at Securitas Portugal

Github: https://github.com/dreispt

Twitter; @reis_pt

Daniel Reis
On 2/27/14, 2:14 PM

As your code snippet shows, osv.osv is deprecated and it still works for backward compatibility.

You should use orm.Model instead.

Daniel is correct. I had OpenERP Technical training recently and the instructor said that the osv.osv is now deprecated and to use the orm.Model instead.

on 2/27/14, 2:27 PM
vimal j
On 2/27/14, 6:45 AM

New openerp object inherits osv.osv as far as i know. We create new objects by inheriting osv.osv class e.g. class newclass(osv.osv):

where, newclass = derived class, osv.osv = base class

Yes Vimal what you say is correct, but osv.osv is now deprecated in the new openobject framework (and it is kept till now just for backward compatibiliy, and it will be surely obsolete in the futur).

Med Said BARA
on 2/27/14, 4:15 PM

Thank you for info Med

vimal j
on 2/28/14, 1:46 AM

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 2/27/14, 4:33 AM
Seen: 6940 times
Last updated: 3/16/15, 8:10 AM