Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
2 ตอบกลับ
5149 มุมมอง

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

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
4
ก.พ. 19
13564
3
พ.ย. 21
7902
1
ก.ค. 17
7774
1
พ.ค. 25
1393
2
ม.ค. 23
2995