Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

What does OSV mean in OpenERP modules?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
modulesormosv
3 Respostes
39013 Vistes
Avatar
P Mittal

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?

6
Avatar
Descartar
Andres Camilo Briñez Nuñez

Hi, I casually meet myself with the following issue. odoo.service - Odoo Open Source ERP and CRM
Loaded: loaded (/lib/systemd/system/odoo.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Sat 2022-01-08 00:20:52 CET; 13min ago
Process: 2458496 ExecStart=/usr/bin/odoo --config /etc/odoo/odoo.conf --logfile /var/log/odoo/odoo-server.log (code=exited, status=1/FAIL>
Main PID: 2458496 (code=exited, status=1/FAILURE)

Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: from .osv.query import Query
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: File "/usr/lib/python3/dist-packages/odoo/osv/__init__.py", line 4, in <module>
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: from . import osv
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: File "/usr/lib/python3/dist-packages/odoo/osv/osv.py", line 5, in <module>
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: from .orm import Model, TransientModel, AbstractModel
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: File "/usr/lib/python3/dist-packages/odoo/osv/orm.py", line 8, in <module>
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: from ..models import (
Jan 08 00:20:52 Bicicletasdelasabana2 odoo[2458496]: ImportError: cannot import name 'MetaModel' from partially initialized module 'odoo.mode>
Jan 08 00:20:52 Bicicletasdelasabana2 systemd[1]: odoo.service: Main process exited, code=exited, status=1/FAILURE
Jan 08 00:20:52 Bicicletasdelasabana2 systemd[1]: odoo.service: Failed with result 'exit-code'.

Avatar
ClueLogics Technologies Pvt. Ltd.
Best Answer

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)

Thanks
sandeep

8
Avatar
Descartar
Avatar
Andreas Maertens
Best Answer

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

http://members.hellug.gr/xrg/openerp-doc/html/api_reference/osv/osv.html

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

11
Avatar
Descartar
Avatar
Brett Lehrer
Best Answer

OSV = Object Service

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

1
Avatar
Descartar
Kalmen Chia

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

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
Autor

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

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.

Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
Tutorial that explains interaction with the OpenERP ORM?
modules orm
Avatar
Avatar
Avatar
2
de març 15
11553
How to use the osv ORM to fetch all products in Python? (Or all customers, or any other type)
python orm osv
Avatar
Avatar
1
de març 15
6733
Change values of a model field at __init__.py Solved
modules models orm api
Avatar
Avatar
1
d’oct. 19
5306
Execute query when installing addon Solved
modules addons orm query
Avatar
Avatar
2
de maig 18
10833
How does ORM method inheritance work?
modules orm openerp7.0 methods
Avatar
0
d’ag. 15
5611
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now