Odoo Help

Welcome!

This community 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.

0

I am trying to insert Data in my Odoo 9 using web Service Api (XML Rpc)and I get these erreur :Can't access : XmlRpcHttpRequestConfig ,XmlRpcHttpRequestConfigImpl and XmlRpcHttpRequestController

By
Rabii47
on 3/23/16, 6:52 AM 756 views

Here is my Code : 

public class OpenERP extends  AsyncTask<Context, Void, Void>{

final String TAG = "ERP";
 final String url = "192.168.1.11:8069";
 final String db = "Rabii";
 final String username = "admin";
 final String password = "123";
 String a[] = new String[]{db, username, password};
 List<String> list = new ArrayList<String>(Arrays.asList("", "", "", ""));
 Map emptymap = emptyMap(); List<String> list1 = new ArrayList<String>(Arrays.asList("", "", "", "", ""));
 
@Override
protected Void doInBackground(Context... params) {
 try {
 final XmlRpcClient client = new XmlRpcClient();
 final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
 common_config.setServerURL(new URL(String.format("%s/xmlrpc/2/common", url)));

 int uid = (int)client.execute( common_config, "authenticate", asList(db, username, password, emptyMap()));
 
 final XmlRpcClient models = new XmlRpcClient() { { setConfig(new XmlRpcClientConfigImpl() {{ setServerURL(new URL(String.format("%s/xmlrpc/2/object", url))); }});
 } }; final Integer id = (Integer) models.execute("execute_kw", list2( db, uid, password,"pointage.task", "create",
 asList(new HashMap() {{ put("name", "New Partner"); }}) )); }
 catch (MalformedURLException e) { Log.e(TAG, "URL exception: " + e.getMessage()); }
return null ; }
 private List asList(String db, String username, String password, Map<Object, Object> objectObjectMap)
 { return null; }}

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/23/16, 6:52 AM
Seen: 756 times
Last updated: 3/23/16, 8:04 AM