Hello guys,
I wanna update the product's info from my data file.
I tried this way but unsuccessfully result.
<!-- moduleone/data/product_data.xml -->
<data noupdate="False">
<record forcecreate="False" model="product.template" id="product_15">
<field name="id">15</field>
<!-- <field name="name">Raid 2</field> I wanna update (nocreate) this product -->
<field name="family_geek_ids" eval="[(6, 0, [ref('family_geek_1')])]"/>
</record>
</data>
<!-- moduleone/data/family_geek_data.xml -->
<data noupdate="1">
<record model="family_geek" id="family_geek_1">
<field name="name">Family Geek Of Nigeria</field> <!-- Created: yes -->
</record>
</data>
Helps !!
Thanks.
As stated in another question of you I've answered.. don't set ID fields in XML records:
<field name="id">15</field>
What exactly do you want to achieve? Update this record every single time or? Why don't you work with CSV imports?
My goal is to: with my mondule, I install it with my data in my file and once installed, it automatically creates the link between the products with their own ID.
Currently, it creates the data and I want it updated.
product_id: 1245, product_name:Raid 2.
Install my module:
product_id:1245, product_name:Raid2, family_geek_ids:2.
No :
product_id:1245, product_name:Raid2.
product_id:2245, product_name:Raid2, family_geek_ids:2.
Thanks.