Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
4482 มุมมอง

I'm using the external API PHP $common = ripcord::client("$url/xmlrpc/2/common");

I would like to search account.move, I'm have trouble using the following code and adding properties to get it to work.

$s_id =  $models->execute_kw($db, $uid, $password, 'account.move', 'search', array(array(array('xxx', '=', 'xxx'))))  ;

where can I find the properties for this API. Example, what should these xxx be.

Thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

require_once 'ripcord.php';


// Odoo server information

$url = 'http://your_odoo_server_url';

$db = 'your_database';

$username = 'your_username';

$password = 'your_password';


// Common service

$common = ripcord::client("$url/xmlrpc/2/common");


// Authenticate and get user ID

$uid = $common->authenticate($db, $username, $password, array());


// Models service

$models = ripcord::client("$url/xmlrpc/2/object");


// Search for account.move records

$search_domain = array(

    array(

        // Add your search criteria here

        array('field_name', '=', 'field_value'),

        // Additional conditions can be added with 'OR' or 'AND'

        // array('another_field', '=', 'another_value'),

    )

);


// Execute search

$account_move_ids = $models->execute_kw($db, $uid, $password, 'account.move', 'search', $search_domain);


// Now $account_move_ids contains the IDs of the matching account.move records

thanks

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

I have created an Odoo Tools site. You can find it on GitHub if you search for "odoo php tools". Hopefully you can use this for inspiration.

/Kjeld

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Please refer this document

https://www.odoo.com/documentation/17.0/developer/reference/external_api.html

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hello,

Did you manage to find the list of available fields ? I am trying to search invoices by name but I just get an access denied... I can search by state but that's not enough for me...

Best regards

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
พ.ย. 22
2111
2
มิ.ย. 25
1977
1
มี.ค. 25
1644
0
ธ.ค. 24
977
0
พ.ย. 24
1268