Odoo Help


About deprecated models in v7

Sudhir Arya (SA)
on 3/26/13, 4:14 AM 3,836 views

In v7, I found that there are some models which are deprecated.

I found three deprecated models in osv.

So it means that now onwards we should not use osv.osv, osv.osv_memory and osv.osv_abstract.

But I was surprised when I looked into the addons, osv.osv and osv.osv_memory are used.

So I am wondering why those models are deprecated?

+1 for nice question.

on 3/26/13, 4:20 AM

Nicolas Bessi

--Nicolas Bessi--
| 5 7 8
Lausanne, Switzerland
--Nicolas Bessi--
Nicolas Bessi
On 3/26/13, 4:26 AM


osv and osv_memory are just aliases to Model and TransientModel. They are still here for backward compatibility and will be supress with next release.

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

in osv code.

So in my scripts I should use Model.osv when defining a new model? class my_object(osv.osv):

should be:

class my_object(Model.osv):

on 3/26/13, 7:39 AM

Yes @patrick. You should use osv.Model instead of osv.osv and osv.TransientModel instead of osv.osv_memory.

Sudhir Arya (SA)
on 3/26/13, 9:11 AM

In fact the recommended solution is from openerp.osv import orm, fields,... then do class X(orm.Model): class Y(orm.TransientModel):

Camptocamp SA
on 3/26/13, 9:16 AM

Yes. Instead of from osv or from toole, etc, we should use from openerp.osv or from openerp.tools, etc.

Sudhir Arya (SA)
on 3/26/13, 9:22 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

1 follower(s)


Asked: 3/26/13, 4:14 AM
Seen: 3836 times
Last updated: 2/15/17, 1:20 PM