Blog

How-To

OpenERP PHP Connector

OpenERP is a great Open Source ERP System. The structure of Client-Server and talking by XML-RPC it make it powerfull to intigrate with other systems. There are a lot of thinks done and in progress.

But we announce a new way to work with OpenERP and any other PHP application. We build a PHP Connector you can include as liberay. The idear is not new you can find a simular project for Ruby or Java.

How it works in PHP?

include 'openerp.class.php';
 
// connection parameter
$parameter = new OpenERPParameter();
$parameter->user = "USERNAME";
$parameter->password = "PW";
$parameter->dbname = "DB";
$parameter->url = "SERVER";
$parameter->port = "8069";
$parameter->protokoll = "http";
 
// create connector
$openerp = new OpenERPConnector( $parameter );
 
// create a new model for the ressource "res.partner"
$partner = new OpenERPModel( $openerp, "res.partner" );
// get all partners
$search = $partner->search('id', '>=', '0');
foreach( $search as $p ){
   // $p is from type OpenERPModelInstance
   // - has magic get and set method
   // - auto loads relation as models
   // - save() to store changes to OpenERP
 
   // print partner name
   echo $p->name ."\n";
   // print the related receivable account
   echo "related receivable account: " $p->property_account_receivable->name .": ". $p->property_account_receivable->amount ."\n\n";
}

The Libery is independent from any modul you install on OpenERP it dynamic loads all available attributes. You can use it in any PHP Application you want to connect with OpenERP. It is a CMS like Joomla, WordPress, Typo3, etc or is a Shop-System like Magento, Oxid, OS-Commerce, Presta, etc. or any other PHP Application you Use in your commpany like Groupware, Webmail, Projekt and Tasktracking system.

We have build a first Plugin using our libery for MantisBT to store the working hours in OpenERP direktly on the Task-View.

Are you intresset to use this libery? Please contact us via info@initos.com.  At the moment we are looking for partner and projects to improve our work and share cost and work. Later we will make it as Open Source public available.

zurück zur Übersicht