Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
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();
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 4/22/13, 6:35 AM|
|Seen: 6376 times|
|Last updated: 5/25/16, 8:07 AM|