Created
July 21, 2013 16:19
-
-
Save dsuch/6049004 to your computer and use it in GitHub Desktop.
Zato-OpenERP integration usage example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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