Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
5073 Visualizzazioni

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
Abbandona
Autore Risposta migliore

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
Abbandona
Risposta migliore

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

i am bit new here

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
4
feb 19
13486
3
nov 21
7844
1
lug 17
7713
1
mag 25
1345
2
gen 23
2916