Odoo Help

Welcome!

This community 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.

3

osv.osv or orm.Model [Closed]

By
fussions
on 2/27/14, 4:33 AM 5,142 views

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?

6

Daniel Reis

--Daniel Reis--
3436
| 6 7 9
Lisbon, 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.

Eric
on 2/27/14, 2:27 PM
0
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

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