readJohn
readJohn

Reputation: 173

Create a new record with one2many

I want to create a new line in stock.picking, which will contain the date and the quantity:

 myRec.pack_lot_ids.create({'id': my_id,'qty': myQty})

There's no error,but the line is not created,SO I tried with

 myRec.pack_lot_ids.create(0,0,{'id': my_id,'qty': myQty})

There I have an error : only 2 args, 4 given.

Is there another way to create a line of one2many

Upvotes: 0

Views: 170

Answers (1)

Himanshu Sharma
Himanshu Sharma

Reputation: 716

myRec.pack_lot_ids.create({'id': my_id,'qty': myQty}) : this is correct you need to pass the parent ID to establish a link.

Upvotes: 2

Related Questions