Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
2 Odpowiedzi
5076 Widoki

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?

Awatar
Odrzuć
Autor Najlepsza odpowiedź

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

Awatar
Odrzuć
Najlepsza odpowiedź

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

i am bit new here

Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
4
lut 19
13487
3
lis 21
7847
1
lip 17
7719
1
maj 25
1352
2
sty 23
2919