I need to create sale order line records based on data recieved from outside and I need to write values in those fields
in which some are relational fields and so i need to select those records from another model how is it possible to write that fields while creating a record.
example--
vals = {'order_id':sale_order,
'product_id': product_id_t,
'price_unit': price_unit_t,
'product_uom_qty': product_uom_qty_t,
'price_subtotal': price_unit_t,
'qty_delivered': product_uom_qty_t,
'state':state_t ,
'name':name_t ,
}
sale_line=self.env['sale.order.line']
sale_line.create(vals)
here product_id is a relational field corresponding to a product record and inorder to create this record what should i write to product_id OR What should i do to link that product record in sale order line record