Help

osv.osv or orm.Model

Closed
Avatar
fussions

The question has been closed

by
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?

Avatar
Discard
2 Answers
7
Avatar
Daniel Reis
Best Answer

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

You should use orm.Model instead.

1 Comment
Avatar
Discard
Avatar
Eric
-

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.

0
Avatar
vimal j
Best Answer

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

2 Comments
Avatar
Discard
Avatar
Med Said BARA
-

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).

Avatar
vimal j
-

Thank you for info Med