I am trying to create some custom demo data for testing in Odoo v17 in xml
currently i am struggling with the creation of product.product while inheriting from product.template
this is the code that i currently have:
<record id="sales_test_1_product_template" model="product.template">
<field name="name">The better table</field>
<field name="detailed_type">product</field>
<field name="invoice_policy">delivery</field>
<field name="tracking">serial</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Solid wood table.</field>
<field name="standard_price">200</field>
<field name="list_price">500</field>
<field name="image_1920" type="base64" file="mrp/static/img/table.png"/>
</record>
<record id="sales_test_1_product_template_product1" model="product.product">
<field name="product_tmpl_id" ref="sales_test_1_product_template"/>
<field name="default_code">FURN_009</field>
<field name="standard_price">299</field>
<field name="list_price">520</field>
</record>
the error that i get when trying to run this is this:
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "product_product_combination_unique"
DETAIL: Key (product_tmpl_id, combination_indices)=(74, ) already exists.
i assume this is because the product.template creates a default product with the Key (74, ), and then when i try to create a product.product, i am trying to create a product with the same Key. I cant figure out how to change this "Key"
My goal is to get 3 pieces of the product to be "on hand", 3 different Serial Numbers, while being visible for a certain company