Hi
In Odoo server actions with python code i know the command to update a record (with record.write). But I would like to know the command to create records. What is this command? See below
#Server action with python code on model sale.order,code:
taxId = None
sType = record.opportunity_id.x_studio_type
if sType == 'Renovatie':
taxId = [87]
if sType == 'Nieuwbouw':
taxId = [82]
if sType == 'BTW Verlegd':
taxId = [89]
if taxId != None:
for record in record.order_line:
record.write({'tax_id':taxId})
Here I would like to create a sale order line in a sale order. What is the command for this.