Skip to Content
Odoo Menu
  • Sign in
  • Try it free
  • Apps
    Finance
    • Accounting
    • Invoicing
    • Expenses
    • Spreadsheet (BI)
    • Documents
    • Sign
    Sales
    • CRM
    • Sales
    • POS Shop
    • POS Restaurant
    • Subscriptions
    • Rental
    Websites
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Supply Chain
    • Inventory
    • Manufacturing
    • PLM
    • Purchase
    • Maintenance
    • Quality
    Human Resources
    • Employees
    • Recruitment
    • Time Off
    • Appraisals
    • Referrals
    • Fleet
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Events
    • Marketing Automation
    • Surveys
    Services
    • Project
    • Timesheets
    • Field Service
    • Helpdesk
    • Planning
    • Appointments
    Productivity
    • Discuss
    • Approvals
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    Third party apps Odoo Studio Odoo Cloud Platform
  • Industries
    Retail
    • Book Store
    • Clothing Store
    • Furniture Store
    • Grocery Store
    • Hardware Store
    • Toy Store
    Food & Hospitality
    • Bar and Pub
    • Restaurant
    • Fast Food
    • Guest House
    • Beverage Distributor
    • Hotel
    Real Estate
    • Real Estate Agency
    • Architecture Firm
    • Construction
    • Estate Management
    • Gardening
    • Property Owner Association
    Consulting
    • Accounting Firm
    • Odoo Partner
    • Marketing Agency
    • Law firm
    • Talent Acquisition
    • Audit & Certification
    Manufacturing
    • Textile
    • Metal
    • Furnitures
    • Food
    • Brewery
    • Corporate Gifts
    Health & Fitness
    • Sports Club
    • Eyewear Store
    • Fitness Center
    • Wellness Practitioners
    • Pharmacy
    • Hair Salon
    Trades
    • Handyman
    • IT Hardware & Support
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    Others
    • Nonprofit Organization
    • Environmental Agency
    • Billboard Rental
    • Photography
    • Bike Leasing
    • Software Reseller
    Browse all Industries
  • Community
    Learn
    • Tutorials
    • Documentation
    • Certifications
    • Training
    • Blog
    • Podcast
    Empower Education
    • Education Program
    • Scale Up! Business Game
    • Visit Odoo
    Get the Software
    • Download
    • Compare Editions
    • Releases
    Collaborate
    • Github
    • Forum
    • Events
    • Translations
    • Become a Partner
    • Services for Partners
    • Register your Accounting Firm
    Get Services
    • Find a Partner
    • Find an Accountant
    • Meet an advisor
    • Implementation Services
    • Customer References
    • Support
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Get a demo
  • Pricing
  • Help

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

  • CRM
  • e-Commerce
  • Accounting
  • Inventory
  • PoS
  • Project
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Tags (View all)
odoo accounting v14 pos v15
About this forum
Help

What does OSV mean in OpenERP modules?

Subscribe

Get notified when there's activity on this post

This question has been flagged
modulesormosv
3 Replies
38995 Views
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
Discard
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
Discard
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
Discard
Avatar
Brett Lehrer
Best Answer

OSV = Object Service

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

1
Avatar
Discard
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
Author

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!

Sign up
Related Posts Replies Views Activity
Tutorial that explains interaction with the OpenERP ORM?
modules orm
Avatar
Avatar
Avatar
2
Mar 15
11545
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
Mar 15
6730
Change values of a model field at __init__.py Solved
modules models orm api
Avatar
Avatar
1
Oct 19
5301
Execute query when installing addon Solved
modules addons orm query
Avatar
Avatar
2
May 18
10813
How does ORM method inheritance work?
modules orm openerp7.0 methods
Avatar
0
Aug 15
5598
Community
  • Tutorials
  • Documentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Translations
Services
  • Odoo.sh Hosting
  • Support
  • Upgrade
  • Custom Developments
  • Education
  • Find an Accountant
  • Find a Partner
  • Become a Partner
About us
  • Our company
  • Brand Assets
  • Contact us
  • Jobs
  • Events
  • Podcast
  • Blog
  • Customers
  • Legal • Privacy
  • Security
الْعَرَبيّة 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 is a suite of open source business apps that cover all your company needs: CRM, eCommerce, accounting, inventory, point of sale, project management, etc.

Odoo's unique value proposition is to be at the same time very easy to use and fully integrated.

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