Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
5101 Näkymät

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?

Avatar
Hylkää
Tekijä Paras vastaus

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

Avatar
Hylkää
Paras vastaus

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

i am bit new here

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
helmik. 19
13547
3
marrask. 21
7874
1
heinäk. 17
7743
1
toukok. 25
1375
2
tammik. 23
2961