Last updated 5 August 2014. Created on 15 November 2010.
Edited by pal4life, podarok, BoogieBug. Log in to edit this page.

This document describes the API provides by the OpenERP Proxy API module. The target audience of this document is the developers and should have some background about configuring and/or developing modules on OpenERP Server.

The OpenERP Proxy API module provides the XML-RPC connection to OpenERP server using the authentication information provided by each user or the default user information provided by the system administration. Depends on the user's rights on the OpenERP server, the developers can develop the module to search, retrieve, create, update or delete the data on the OpenERP server.

Call Sequence

Most of the applications can fulfill their needs by just using the following call sequence:

$proxy = OpenERPProxy::getProxy();
$ids = $proxy->search('MyOpenERPModel', $criteria, 0, 0)
$res = $proxy->read('MyOpenERPModel', $ids, $fields) as $row );

The block of code above let the API handle the authentication process, request for searching and return with the ids those match the criteria, and then read the whole set of results. The developer can then utilize the results as required.

As you see that the code is in the object-oriented-style. The whole API is wrapped into a class of OpenERPProxy with the singleton construction method getProxy() which will return the same OpenERPProxy object on every call. Using this creation behavior will ensure that each HTTP request session will consume only one server connection, therefore, does not push too much workload on the server.

You will find the details of the OpenERPProxy class in the next section.

This document is still under progress. Please feel free to raise any issues or suggestion you may have on the project page.

Looking for support? Visit the forums, or join #drupal-support in IRC.