How can i add tax to an sale.order.line? (version 7)
The order+lines are created "correctly", but without tax.
When i debug in Eclipse I can see that the tax_id string is filled, when using the xml-rpc example below in the osv/orm.py line 4303, but in addons/sale/sale.py line 664:
taxes = tax_obj.compute_all(cr, uid, line.tax_id, price, line.product_uom_qty, line.product_id, line.order_id.partner_id)
line.tax_id contains "list[]".
when creating the same order using the normal web interface line.tax_id reads "browse_record_list: [browse_record(account.tax, 7)]"
Here is my example: ('tax_id'=>new xmlrpcval('[(6, 0, [7, 7])]', 'string'), ) ; Tax id 7, Tax amount 7.
$OrderPrd = array(
'name'=>new xmlrpcval($order_name, 'string'),
'order_id'=>new xmlrpcval($order_id, 'int'),
'product_id'=>new xmlrpcval($value, 'int'),
'product_uom_qty'=>new xmlrpcval(5, 'int'),
'product_uom' =>new xmlrpcval(1, 'int'),
'product_uos_qty'=>new xmlrpcval(5, 'int'),
'product_uos' =>new xmlrpcval(1, 'int'),
'price_unit'=>new xmlrpcval(2000 ,'int'),
'price_subtotal'=>new xmlrpcval(1000 ,'int'),
'delay'=>new xmlrpcval(2 ,'float'),
'tax_id'=>new xmlrpcval('[(6, 0, [7, 7])]', 'string'),
'type'=>new xmlrpcval('make_to_stock', 'string'),
);
$this->msg = new xmlrpcmsg('execute');
$this->msg->addParam(new xmlrpcval($this->database, "string"));
$this->msg->addParam(new xmlrpcval(1, "int"));
$this->msg->addParam(new xmlrpcval($this->password, "string"));
$this->msg->addParam(new xmlrpcval("sale.order.line","string"));
$this->msg->addParam(new xmlrpcval("create", "string"));
$this->msg->addParam(new xmlrpcval($OrderPrd, "struct"));
$this->res = &$this->client->send($this->msg);
$order_id_line[] = $this->res->value()->scalarval();