Hi,
First, thank you for your time.
I would like to get and set the default tax for my product.
The creation is little different than usual. I create automatically two product for each order.
I would like to get and set the tax_id for this two products. But I have not a clue...
My code:
def create(self, cr, uid, vals, context=None):
context = context or {}
sol = self.pool.get('sale.order.line')
if vals.get('name','/')=='/':
vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'sale.order') or '/'
res = super(sale_order, self).create(cr, uid, vals, context=context)
# res is the id of the created sale order, and we create 2 lines with product_1 and product_2. Here I would like ti add tax_id:
self.write(cr, uid, [res], {'order_line': [[0, 0, {'product_id': 1,'name': 'Service','price_unit': 50}], [0, 0, {'product_id': 4,'name': 'transport','price_unit': 15}]]})
return res