Connecting your Python App to OpenERP through OOOP
1. Connecting your Python App
to OpenERP through OOOP
Raimon Esteve
January 2011
Licence Creative Commons: Attribution-NonCommercial 3.0 Unported (CC BY-NC 3.0
More information to http://creativecommons.org/licenses/by-nc/3.0/
To Share — to copy, distribute and transmit the work. To Remix — to adapt the work. Attribution — You must
attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they
endorse you or your use of the work). Noncommercial — You may not use this work for commercial purposes.
Logos are OpenERP S.A and OOOP project.
3. OpenERP
ERP application clientserver
Official modules: product, sale, account, stock,..
Extra modules: see addonsextra, addonscommunity
or other projects in Launchpad
OpenObject
Framework written by python
20. New
1. $ python
2. >>> from ooop import OOOP
3. >>> o = OOOP(dbname='demo')
4. >>> n = o.ResPartner.new()
5. >>> n.name = 'Partner created with OOOP'
5. >>> n.save()
1. $ python
2. >>> from ooop import OOOP
3. >>> o = OOOP(dbname='demo')
4. >>> n = o.ResPartner.new(name='Zikzakmedia', active=True)
6. >>> n.save()
21. New with related objects. Part I
1. $ python
2. >>> from ooop import OOOP
3. >>> o = OOOP(dbname='demo')
4. >>> n = o.ResPartner.new()
5. >>> n.name = 'Partner created with OOOP'
6. >>> addr = o.ResPartnerAddress.new()
7. >>> addr.street = 'New Address'
8. >>> n.address.append(addr)
9. >>> n.save_all()
22. New with related objects. Part II
1. $ python
2. >>> from ooop import OOOP
3. >>> o = OOOP(dbname='demo')
4. >>> m = [o.ResPartnerAddress.new(name='New Address',
street='New Street', active=True)]
5. >>> n = o.ResPartner.new(name='Zikzakmedia', address=m,
active=True)
6. >>> n.save_all()