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

xml-rpc search workorders (using PHP)

By
Michael Watchorn
on 11/12/13, 10:19 PM 1,491 views

I'm trying to select all the open work orders using the openerp-php-connector.
This is what my code looks like:

include_once('openerp.class.php');
$rpc = new OpenERP();
$rpc->login("admin", "admin", "MyDB", "localhost:8069/xmlrpc/");
$work_order_ids = $rpc->search('mrp.production.workcenter.line', 'state', 'is not', 'done', 'string');
echo 'OPEN WORK ORDER IDS:';
print_r($work_order_ids );

It works when I try to search for name like TestCustomer in the res.partner model:

$work_order_ids  = $rpc->search('res.partner', 'name', 'like', 'TestCustomer', 'string');

but not with state is not done in the Work Order model . I'm wondering is it case sensitive? Do I have to change the field to be searchable? When I use the Settings->Technical->Database Structure->Model view and look at the mrp.production.workcenter.line fields I see that most fields (including the state) are marked "Not Searchable". Is this my problem? How do I make them searchable? (I tried editing it there and I received an error indicating I should make the change through code, but I haven't seen anything in the docs that explicitly shows how to do that.)

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

0 follower(s)

Stats

Asked: 11/12/13, 10:19 PM
Seen: 1491 times
Last updated: 3/16/15, 8:10 AM