Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
5087 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

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'})

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

i am bit new here

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 2 19
13522
3
thg 11 21
7861
1
thg 7 17
7735
1
thg 5 25
1363
2
thg 1 23
2938