Community mailing list archives

community@mail.odoo.com

Re: How can I do a xmlrpc-Search via a many2many-field (from account.invoice.line to account.tax)?

by
richard
- 02/13/2015 08:13:18
hello,

there my  code,you must just update

if($products_code_tax != null) {
$ids = $OSCOM_ODOO->odooSearch('description', '=', $products_code_tax, 'account.tax', 'string');
$odoo_products_tax_id = $ids;
$odoo_products_tax_id = $odoo_products_tax_id[0];

if (!empty($odoo_products_tax_id)) {

$type_tax_string = 'array';

$tax = array(new xmlrpcval(
array(
new xmlrpcval(6, "int"),// 6 : id link
new xmlrpcval(0, "int"),
new xmlrpcval(array(new xmlrpcval($odoo_products_tax_id, "int")), "array")
), "array"
)
);
} else {
$tax = 0;
$type_tax_string = 'int';
}
} else {
$tax = 0;
$type_tax_string = 'int';
}
// **********************************
// Write a new line concerning the invoice
// **********************************

$values = array (
"tax_id" => new xmlrpcval($tax, $type_tax_string),
);

$OSCOM_ODOO->createOdoo($values, "sale.order.line");

} //end for





Community - Help up ClicShopping to be in Bitmani project : we need your vote : https://bitnami.com/stack/clicshopping - Thank you

------------------------
Cordialement,
Loïc Richard

Découvrez ClicShopping, la première solution de social ecommerce openSource à intégrer l'achat compulsif !! Et maintenant qui a une relation avec Odoo (ERP)

Discover ClicShopping, first open source social solution  to integrate the compulsive purchase. And know a relation with Odoo (ERP)






2015-02-13 7:43 GMT-05:00 Mathias Neef <mn@copado.de>:

Hi!

I want to do a search via xmlrpc from account.invoice.line via the account_invoice_line_tax table which is the many2many table for account.tax.

This is the code, which is not working, becaus account_invoice_line_tax is not a model:
line_tax_ids = sock.execute(dbname, uid, pwd, 'account.invoice.line.tax', 'search', [('invoice_line_id', '=', invoice_line['id'])])

Thank your for your help in advance.


Best regards, Mathias.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe