I came across the word "osv" in almost all the OpenERP modules. What does it stand for? Has it something to do with the OpenERP Object Relational Mapper?
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
_defaults and other many things there such as
name etc so we must inherit in our openerp model (class)
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. ;)
OSV = Object Service
Keeps the definitions of objects and their fields in memory, more or less.
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.)
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.