Skip to content

Instantly share code, notes, and snippets.

@dsuch
Created July 21, 2013 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dsuch/6049004 to your computer and use it in GitHub Desktop.
Save dsuch/6049004 to your computer and use it in GitHub Desktop.
Zato-OpenERP integration usage example
from zato.openerp import OpenERPService
class MyOEService(OpenERPService):
def handle(self):
# Fetch connection to OpenERP
oe = self.openerp.get('my-oe-instance')
# Grab info on user by their login
model = oe.conn.get_model('res.users')
info = model.search_read([('login', '=', 'admin')])
# And log user's name
self.logger.info('name is {}'.format(info[0]['name']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment