Skip to Content
Menu
This question has been flagged
1 Reply
2775 Views

Hi all:

I try to create a BOM using odoorpc

if i create an empty BOM for the product number 6 it works

bom_id=odoo.execute('mrp.bom','create',{'product_tmpl_id':6})

But i do not manage to add lines to my BOM for exemple to add

bom_id=odoo.execute('mrp.bom','create',{'product_tmpl_id':6,'bom_line_ids':[(0,0,[3,2,4])]}) but it do not work i try :[(6,0,[3,2,4])] and many other solution with no good result

my product.template looks 

ID; name

"1";"prod1"
"2";"lprod1"
"3";"lprod2"
"4";"lprod3"
"5";"testrpc"
"6";"prodbom1"
So where is my mistake.

Thanks for any help

Avatar
Discard
Best Answer

Hello,

Please try the bellow code.

This may help.

vals = {'product_tmpl_id': 139,
'product_qty': 1,
'type': 'normal',
'bom_line_ids': [(6, 0,[3,4])]
}
sock.execute_kw(dbname, uid, pwd, 'mrp.bom', 'create', [vals])

Avatar
Discard
Related Posts Replies Views Activity
2
May 24
1052
0
Apr 24
567
0
Feb 23
1273
8
Feb 21
24301
0
Dec 19
3497