I have a sales record
models.execute_kw(db, uid, password, 'sale.order', 'create', [{
'partner_id': 10,
'order_line': [(0, 0, {'product_id':1,'product_uom_qty':2}),
I need to be able to create 'order_line' programaticaly based on a number from a variable. For example if variable = 3
models.execute_kw(db, uid, password, 'sale.order', 'create', [{
'partner_id': 10,
'order_line': [(0, 0, {'product_id':1,'product_uom_qty':2}),
'order_line': [(0, 0, {'product_id':1,'product_uom_qty':2}),
'order_line': [(0, 0, {'product_id':1,'product_uom_qty':2}),
I followed the exact steps from here, https://www.odoo.com/forum/help-1/question/programmatically-create-a-sale-order-line-99981. But I keep getting errors as it seems Odoo has changed quite a bit since 2016. What would be the best way to go about this?