تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3850 أدوات العرض

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?

الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
يونيو 24
1732
1
فبراير 22
4634
0
أغسطس 21
2720
1
مارس 21
12215
2
ديسمبر 19
16020