跳至內容
選單
此問題已被標幟
2 回覆
5071 瀏覽次數

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
13481
3
11月 21
7842
1
7月 17
7708
1
5月 25
1344
2
1月 23
2916