Odoo Help


TypeError: 'bool' object has no attribute '__getitem__' in android

on 4/10/16, 1:17 PM 1,488 views

Guys please help this is my code 

Object[] l = { "is_company", "=", false }; 
Object[] filter = { l };
odoo = new OdooUtility("", "object"); 
SearchIdTask = odoo.exec(listner, "db","1","password","res.partner","search",filter);
and here is the exec method
public Long exec (XMLRPCCallback listner, String db, String uid, String password,String objects, String method, Object[] data){    
Long id = client.callAsync(listner,"execute_kw",db,Integer.parseInt(uid),password,objects,method,data);
return id;

pls I've been looking at this for hours i think there is something wrong with the filter :'(

on 4/10/16, 1:19 PM
On 4/10/16, 6:01 PM

Thank you so much for your answer but i still get the same error, i'm affraid if i try the second code it wont work bc xmlrpc in android doesn't work well because i'm using a light weight library called aXMLRPC that was develppd by someone in github


Hardikgiri Goswami

--Hardikgiri Goswami--
| 2 2 5
Rajkot, India
--Hardikgiri Goswami--

OpenERP/Odoo Customization/Integration Expert / Python Programmer

Email : hardikgiri.goswami@gmail.com

Skype ID : hardikgiri.goswami

Hardikgiri Goswami
On 4/10/16, 4:55 PM

Hi Hanane,

In your code Object Array should be define as follow:

Object[] l = new Object[]{ "is_company", "=", false};
Object[] filter = new Object[]{l};

You can try following working code for java :

package odoo.java;
import java.net.MalformedURLException;
import java.net.URL;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
import org.apache.xmlrpc.client.XmlRpcClientConfigImpl;
public class JavaOdoo {
public static void main(String[] args){
final XmlRpcClient client = new XmlRpcClient();
Object[] emptyList = new Object[]{};
final String url = "";
final String db = "demo_80";
final String username = "admin";
final String password = "a";
System.out.print("Hello World");
final XmlRpcClientConfigImpl common_config = new XmlRpcClientConfigImpl();
try {
new URL(String.format("%s/xmlrpc/2/common", url)));
client.execute(common_config, "version", emptyList);
int uid = (int)client.execute(
common_config, "authenticate", new Object[]{db, username, password, emptyList});
final XmlRpcClient models = new XmlRpcClient() {{
setConfig(new XmlRpcClientConfigImpl() {{
setServerURL(new URL(String.format("%s/xmlrpc/2/object", url)));
Object[] res = (Object[]) models.execute("execute_kw", new Object[]{
db, uid, password,
"res.partner", "search",
new Object[]{new Object[]{
new Object[]{"is_company", "=", false}}}
                         // printing ids of partner which have is_company false.
for(int i=0;i<res.length;i++){
} catch (XmlRpcException | MalformedURLException e) {
// TODO Auto-generated catch block


Hardikgiri Goswami


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: 4/10/16, 1:17 PM
Seen: 1488 times
Last updated: 4/10/16, 6:01 PM