Skip to content


Subversion checkout URL

You can clone with
Download ZIP
OpenObject On Python
branch: master

Merge pull request #21 from vaab/fix-typos

Fixed filename typo and removed the bogus PNG file from the
latest commit 4729a8833c
@lasarux authored
Failed to load latest commit information.
doc initial commit
examples added examples eliminate the io import
.gitignore ADD. Some files to .gitignore
AUTHORS Impulzia is the leader now. :-)
COPYING fix typo in filename removed the 3.4Mb PNG from the that freezed or killed major… minor typo in comment Minor changes in order to work with outdated jython. eliminate some test files eliminated print when used as module

Warning: this is a very initial release.

Contacting us:

Discussion group: openerp-ooop Post Issues on github: GITHUB Issues

How to install?


$ python install


$ jython install

Examples (python console):

Connecting to server

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')

Retrieving all from model

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')
  >>> o.ResPartner.all()

Retrieving 1 record from model

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')
  >>> n = o.ResPartner.get(1)

Accesing attributes

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')
  >>> n = o.ResPartner.get(1)
  >>> print

or in related objects:

  >>> print len(n.address) 
  >>> print n.address[0].name 

Deleting 1 record

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')
  >>> n = o.ResPartner.get(1)
  >>> n.delete()

Deleting multiple records

100 firsts

  >>> from ooop import OOOP
  >>> o = OOOP(dbname='demo')
  >>> n = o.ResPartner.all()
  >>> n[1:100].delete()


  >>> n.delete()


You can extend arguments using ne, lt, lte, gt, gte, like and ilike:

  >>> o.ResPartner.filter(name='Guido')
  >>> o.ResPartner.filter(name__ne='Guido')
  >>> o.ResPartner.filter(name__lt='Guido')
  >>> o.ResPartner.filter(name__lte='Guido')
  >>> o.ResPartner.filter(name__gt='Guido')
  >>> o.ResPartner.filter(name__gte='Guido')
  >>> o.ResPartner.filter(name__like='Guido')
  >>> o.ResPartner.filter(name__ilike='guido')
  >>> o.ResPartner.filter(id__in=[1,2,5,8])
  >>> o.ResPartner.filter(id__not_in=[1,2,5,8])

Creating new

  >>> n =
  >>> = 'Partner created with OOOP'

  >>> n ='Guido', active=True)

with related objects

To save all related objects of an object:

  >>> n =
  >>> = 'Partner created with OOOP'

  >>> addr =
  >>> addr.street = "Testing related objects"

  >>> n.address.append(addr)
  >>> n.save_all()

  >>> m = ['New Address', street='New Street', active=True)]
  >>> n ='Guido', address=m, active=True)
  >>> n.save_all()

Export Graph

Get a model graphviz file in dot, png, jpg or svg:

o.export(filename="file", filetype="dot", showfields=True, model="res.partner", deep=None)

or simply:

o.export("file", "png", False)

also you can do

o.ResPartner.export(filename="file", filetype="png", deep=0)

Also you can generate a jpg file (res.partner.jpg in the example) with just especific table definition


but if you want to get deep in the tables just need:


The deep param its relative to the model param, deep means how far you want to get with the relations.

Something went wrong with that request. Please try again.