Thursday, June 19, 2014

OpenERP xmlrpc API for Ruby : Bintje

Few month ago, I released Bintje, a minimal interface to OpenERP's xmlrpc API:

It is available on github, as a ruby gem, and can be included in the ruby class of your choice ( as a Rails model for example ).

It still an early version, but is usable in production.

Why Bintje ?

So why it is named Bintje ? Because it is part of a bigger piece of architecture called "Barakafrites" which in french means this :
Yes, they sell "french fries".
Bintje is potato variety used for french fries (And have it's own dedicated character).

Now you clearly understand why this project is called Bintje ... ( Just kidding ... )

Using Bintje

First it needs OpenERP / OpenObject backend address, an example setup : Then create a Ruby Class, it could be Rails model if you want : This class inherits the CRUD basic methods, and have an example of custom method declaration.
You first need to include the module, once done your class will inherit module's class methods ( see documentation ), and gain the `open_object_model` class variable which is inferred from your ruby object name, but can be overriden as you can see in this gist above. And now you can query the OpenObject Backend and obtain a BackendResponse Object ( see documentation ) Yes it is so simple ... To get more methods, have a look to the documentation : The behaviour specifications extracted from Rspec tests :