Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3744 Переглядів

I have a list of products, and each have multiple variants. I look into product.template and product.product models, in which product.product inherits from product.template.

I want to program the script to insert those product:

for product in product list:

     Create a product to product.template

     Add all its variants to product.product

Is it the correct way to do this?

However, why can't we insert product to the template model, but only add extra info to the product model? Is there any document explaining how to do it?

Аватар
Відмінити
Related Posts Відповіді Переглядів Дія
1
черв. 24
1596
1
лют. 22
4466
0
серп. 21
2614
1
бер. 21
12046
2
груд. 19
15848