Community mailing list archives

community@mail.odoo.com

How to fetch only employee data using node api?

by
Abdul Qudoos Mehdi
- 06/22/2016 06:29:40
Hi,
I am using Node-odoo api to fetching data from odoo in json format, but I have two issues in it.
my code is

// Connect to Odoo
odoo.connect(function (err) {
    if (err) {
        return console.log(err);
    }
    var ids = []
        //////////////////////// total no. contacts for testing
    for (var i = 1; i <= 100000; i++) {
        ids.push(i);
    }
    var params = {
        ids,
        fields: ['name', 'email']

    }; //params
    odoo.get('res.partner', params, function (err, partners) {
        if (err) {
            return console.log(err);
        }
        obj = partners;

        console.log(partners);
        jsonfile.writeFileSync(file, obj)

    }); //get

by using ''res.partner" I also get junk data, because I don't know the employee record ids, thats why I ended loop to 100000 only for testing,
How can I get employee ids and in which model.
I don't know odoo tecnically..
regards
Abdul Qudoos Mehdi