Ich verwende diese class für den Zugriff auf odoo durch PHP XMLRPC. Alles funktioniert fast gut. Ich kann viele2 Felder nicht nur durch die ID des referenzierten Datensatzes suchen. Ich denke, es sollte eine spezielle Möglichkeit geben, die many2one ID in der Suche zu codieren. Beispiel: durch die product_tmpl_id in product.supplierinfo Suche mit diesem Code i emtpy Array zurückgegeben erhalten:Suche nach Many2One Feld odoo PHP XMLRPC
$rpc->searchread(array(array("product_tmpl_id","=","3673")),"product.supplierinfo");
für die Aufzeichnung von id Suche bekomme ich dieses Ergebnis:
$rpc->read(array(1),"", "product.supplierinfo");
Array
(
[0] => Array
(
[create_uid] => Array
(
[0] => xxxxx
[1] => xxxxx xxxxx
)
[product_code] =>
[create_date] => 2016-06-22 11:08:00
[name] => Array
(
[0] => 1438
[1] => Provider one
)
[product_uom] => Array
(
[0] => 1
[1] => Unit(s)
)
[sequence] => 1
[product_name] =>
[__last_update] => 2016-06-22 11:42:28
[company_id] => Array
(
[0] => 1
[1] => Company Name
)
[write_uid] => Array
(
[0] => xxxx
[1] => xxxxxx xxxxx
)
[delay] => 1
[write_date] => 2016-06-22 11:42:28
[pricelist_ids] => Array
(
)
[display_name] => Provider One
[min_qty] => 0
[qty] => 0
[product_tmpl_id] => Array
(
[0] => 3673
[1] => Product Name
)
[id] => 1
)
)
Wie soll ich den Code ID eines many2one-Feldes? Jede Hilfe wird geschätzt.
Ich bin nicht gewohnt, PHP, aber ich frage mich, warum die ID in Ihrem Sucharray (ersten Code-Snippet) als Zeichenfolge definiert ist? – CZoellner
@CZoellner danke für deine antwort, soweit ich weiß hat das keinen einfluss, da ich das machen kann und den satz richtig finde '$ rpc-> lesen (array (array (" id "," = "," 1 ")), array(), "product.supplierinfo"); ' – rekobeko