I want to programaically add pos_order with lines and everything. I have came very far, but now I'm stuck on this issue. How would I pass tax information to pos_order_line. The model has a field called tax_ids, so my first assumption was to just put tax_ids=[tax_id], but that gets ignored.
After searching many internets, I found out that I need to do something like that:
'tax_ids':[[0, 0, {tax_id}]]
With this I'm getting some xmlrpclib.py error that I don't understand:
File "/usr/lib/python2.7/xmlrpclib.py", line 647, in __dump raise TypeError, "cannot marshal %s objects" % type(value) TypeError: cannot marshal <type 'set'> objects
I'm sorry for spamming the forum, but I cannot help myself with this guy's question, although it looks the same:
https://www.odoo.com/forum/help-1/question/php-xpml-rpc-sale-order-line-tax-id-12763
I added the comment, but I don't think that question will ever get to the top again, so that's why I'm posting a new one.
This is my actual code that creates an order:
vals = {
'session_id': sid,
'partner_id':myord['partner_id'],
'pricelist_id':myord['pricelist_id'],
'user_id':myord['Cashier_user_id'],
'lines': []
}
d
for line in myord['lines']:
vals['lines'].append([0, 0, #I also don't understand why these zeros are here :(
{
'product_id': line['product_id'],
'price_unit': flaot(line['TotalWTax']),
'discount': float(line['DiscountPercent'],
'tax_ids': [[0,0, {line['Tax_id']}]], #This causes my script to crash
'qty': line['Quantity']
}
])