Odoo Help

3 Answers

ClueLogics Technologies Pvt. Ltd.

--ClueLogics Technologies Pvt. Ltd.--
| 6 5 8
Delhi NCR, India
--ClueLogics Technologies Pvt. Ltd.--

 ClueLogics Technologies Pvt Ltd is a Software product and services provider. We are positioned to deliver robust, rapid and reliable Information Technology solutions that work. What we succeed upon is Technology and Technical Expertise. The industry review of ClueLogics has been commendable for the past years as most of its business comes from repeat orders by highly satisfied clients.

ClueLogics Technologies Pvt. Ltd.
5/23/13, 2:59 AM

Hi Mr. Mittal

osv is a class and an OpenERP descriptor class and all the class( model) must inherit it for OpenERP module deployment.

osv class inside in OSV module in OpenERP server , which content all the OpenERP properties like you can see _column, _defaults and other many things there such as name etc so we must inherit in our openerp model (class)



Andreas Maertens

--Andreas Maertens--
| 6 6 7
Finsterwalde, Germany
--Andreas Maertens--

I develop odoo8.0 modules

Andreas Maertens
5/23/13, 4:32 AM

As I tried to find out I came along one site:


There they say: osv = "Objects Services"

It just points to the orm classes.

source: osv.py in server/openerp/osv/osv.py

from openerp.osv.orm import MetaModel, Model, TransientModel, AbstractModel
# deprecated - for backward compatibility.
osv = Model
osv_memory = TransientModel
osv_abstract = AbstractModel # ;-)

So you could also use orm.Model to create addons. It's the same. ;)


Brett Lehrer

--Brett Lehrer--

| 5 5 8
Milwaukee, United States
--Brett Lehrer--
Director of IT and open source enthusiast.
Brett Lehrer
5/23/13, 3:00 AM

OSV = Object Service

Keeps the definitions of objects and their fields in memory, more or less.

Kalmen Chia / E-Global SCM Solutions Sdn Bhd
5/23/13, 3:29 AM

i saw class previously is osv.osv , now is osv.Model , so the later version for new class should begin with osv.Model ?

Brett Lehrer
5/23/13, 3:42 AM

That does work, and seems to be the direction they're pushing, but be careful about inheritance in 7.0 at least. I've noticed issues when trying to inherit, for example, an osv.osv_memory class with an osv.TransientModel class. As long as you're consistent you should be fine.

P Mittal
5/23/13, 5:02 PM

That answers it well. Yes, I also see osv.Model used sometimes where I thought osv.osv should be used. Where can I get a list of all the classes and functions available under "osv" along with what they could be used for. (Reading the osv code for that is one option I have, but I would prefer if I could get some straight docs.)

Brett Lehrer
5/23/13, 5:57 PM

As of just this morning, OpenERP has rolled out an update to their trunk documentation, available here: https://doc.openerp.com/trunk. The page specifically covering object and field functions is here: https://doc.openerp.com/trunk/server/03_module_dev_02

Most OSV functions are actually in orm.py. osv.py is pretty slim and just wraps the execution of actions so that if an error is raised in the middle of an action, the database can be rolled back to it's state prior, avoiding partial records from being written to the database.

Ask a Question
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