تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
5070 أدوات العرض

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
فبراير 19
13481
3
نوفمبر 21
7841
1
يوليو 17
7707
1
مايو 25
1344
2
يناير 23
2916