Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
2 Răspunsuri
5059 Vizualizări

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?

Imagine profil
Abandonează
Autor Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

i am bit new here

Imagine profil
Abandonează
Related Posts Răspunsuri Vizualizări Activitate
4
feb. 19
13478
3
nov. 21
7833
1
iul. 17
7688
1
mai 25
1338
2
ian. 23
2915