コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
5090 ビュー

Hi, with a custom module, I synchronize a lot of products but I would like that their route Make to Order is set on True by default.


How can I do this?

アバター
破棄
著作者 最善の回答

Have to to do this sample code then create the product template :


mto_ids = product_routes.search(['|', ('name', '=', 'Make To Order'), ('name', '=', 'Buy')])

route = []

for d in mto_ids:

route.append(d.id)

tmpl_id = product_tempalte.create({'valuation':'manual_periodic', 'name':champ[3], 'standard_price':champ[5], 'description':champ[3],

'route_ids':[(6, 0, route)], 'type':'product'})

アバター
破棄
最善の回答

How to use the above code, i mean in which file.

i am bit new here

アバター
破棄
関連投稿 返信 ビュー 活動
4
2月 19
13528
3
11月 21
7865
1
7月 17
7737
1
5月 25
1365
2
1月 23
2942