Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
10237 มุมมอง

Hi!

I'm writing a python script which will be used to import new products from CSV files via XML-RPC. The script itself does what it's ment to do, but I'm just wondering if I should really create product.template for every product I create through XML-RPC or should I use the same product.template for all created products and update the product.product data separately? (Or overwrite the same product.template over and over again?)

In all the examples I have seen, everyone seems create a new template for every product created through XML-RPC. Is there some specific reason behind this that I'm not aware about?

Isn't creating new product.template for every new product going to increase the database size with garbage data during time of usage?

  • Mikko
อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

product.product is an extension of product.template. With this system you can create one template and more product variants. the template_id field in product is a required field to create a product.product record. So you need to create a template and to connect its id in the product.

อวตาร
ละทิ้ง
ผู้เขียน

Thank you for the advice!

If I understood this correctly, lets say for example if I execute sock.execute Read for field 'decription' from product.product, the OpenERP actually retrieves the data from product.template with matching 'product_tmpl_id'? And for writing (updating the 'description' field) vice versa?

Yes. If you write a product.template field in a product.product class, OpenERP writes it automatically in product.template.

ผู้เขียน

Thanks!

Please, if you think that my answer is the correct one, mark it as correct so who will search the some answer can see that you solve with it. Thanks

Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ธ.ค. 22
6187
16
ก.ย. 24
77785
3
ต.ค. 22
10402
How to add a custom tag to products? แก้ไขแล้ว
1
ธ.ค. 21
10509
1
พ.ค. 21
6409