Odoo Help


Java ODOO Web API Client

Hassan Moulana
on 1/18/15, 9:07 AM 4,449 views

Dear Odoo Community Members,

I am trying to create a Sales Order from Java Client. I am sucessful by creating a draft quotation but i do not know how to add products into the quotation.

If anybody have a sample in another languages, please share. It will be helpful. 

Here is the code to create the quotation

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;

public class WSMain {

    static String url = "";
    static String db = "EverFresh";
    static String username ="admin";
    static String password = "a";
    public static void main(String[] args) throws Exception {

        final XmlRpcClient authClient = new XmlRpcClient();
        final XmlRpcClientConfigImpl authStartConfig = new XmlRpcClientConfigImpl();
                new URL(String.format("%s/xmlrpc/2/common", url)));
        List configList = new ArrayList();
        Map paramMap = new HashMap();
        int uid = (int)authClient.execute(
                authStartConfig, "authenticate", configList);

        final XmlRpcClient objClient = new XmlRpcClient();
        final XmlRpcClientConfigImpl objStartConfig = new XmlRpcClientConfigImpl();
                new URL(String.format("%s/xmlrpc/2/object", url)));
        List paramList = new ArrayList();
        paramMap.put("partner_id", 1);

        int cid = (int)objClient.execute("execute_kw", configList);
        System.out.println("Your Sales Order is : " + cid);



About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)


Asked: 1/18/15, 9:07 AM
Seen: 4449 times
Last updated: 3/16/15, 8:10 AM