Monday 15 April 2013

Example of xmlrpc and openerp


How to work with xmlrpc and OpenERP?

Here example of xmlrpc and openerp ....
save following file as xmlrpc.py

You can also create xmlrpc for the use of import or export data. Or you can also create a new records also.

Example : 
import xmlrpclib
username = 'admin'
password = 'a'
database = 'test_60A'
sock_comm = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/common')
uid = sock_comm.login(database,username,password)
sock = xmlrpclib.ServerProxy('http://localhost:8069/xmlrpc/object')
print "connection success full"
ids = sock.execute(database,uid, password,'res.company', 'search', [])
print "list of ids",ids
#ids will contain ids of company A and B
sock.execute(database,uid, password, 'res.company', 'write', ids, {'rml_header1': 'hop'})


start server and run file $  python xmlrpc.py

With workflow(invoice validate) :
sock.exec_workflow (dbname, 1, pwd, 'account.invoice', 'invoice_open', inv_id)


Here a example of connect with server and fetch list of ids of company and just call write operation you can do
the operation which needed..


..Enjoy..

Wednesday 10 April 2013

How to apply patch in OpenERP ?



How to apply patch in OpenERP ?


Hello All, I think most of all of you guys in search of "How to apply Patch? Or What is patch?", yes, if you are developer than you know but if you are not a developer than its creates problem about to patch.

Here i try to describe some of steps or trick to apply patch, how it will be helpful to you all.

What is patch ?

Simply, patch is piece of some bug(error) fixing or some improvements of existing system.In another way patch means you are using any software and there is any error or need to improve or something else you want to do with existing system than obisiously you are trying such a thing in temperory source and if its work fine than you have to change in main code

For Apply :

1. If you use Ubuntu (Mind blowing Open Source) than its easy to apply patch.
 From command prompt follow the command :

 Go to particular directory and just apply patch
    > patch -p1 < ~/Desktop/xxx.patch

Or if you are using the Eclipse

2. If you are using Eclipse than also its, became easy to apply patch.
For that right click on addons folder then click on "Team" and select apply patch you will get the wizard to apply the patch.

                          ..Enjoy..


View Larger Map