Skip to Content
Menu
This question has been flagged
2369 Views

Basically I have this code block 

This code works, but I need to create new order lines based on a variable. For example, if the variable = 3, create 3 order lines. I have tried this example but can't get it to work.

so_id = models.execute_kw(db, uid, password, 'sale.order', 'create', [{
'partner_id': 10,
'order_line': [(0, 0, {'product_id':x,'product_uom_qty':quantity}),
(0, 0, {'product_id': 1, 'product_uom_qty': 1})]
}])

Avatar
Discard
Related Posts Replies Views Activity
1
Nov 24
150
1
Apr 23
1470
7
Feb 23
7484
0
Sep 22
949
1
Jul 22
472