Ir al contenido
Menú
Se marcó esta pregunta

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.

Avatar
Descartar

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?

Autor

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.

Publicaciones relacionadas Respuestas Vistas Actividad
3
mar 15
13691
3
sept 23
3979
1
jul 19
6842
1
nov 18
4028
0
dic 17
3483