Hello everyone !
I wanna load default data into my database with my module.
The issue is:
// Family geek model
class FamilyGeek(model.Model):
_name = 'family.geek'
name = fields.Char(..........)
// data/family_geek_data.xml
<record model="family.geek" id="fg1">
<field name="id">1</field>
<field name="name">Geek Family</field>
</record>
// Family house model
class FamilyHouse(model.Model):
_name = 'family.house'
name = fields.Char(..........)
family_geek_ids = fields.One2many('family.geek',ondelete='SET NULL | CASCADE or More')
// data/family_house_data.xml
<record model="family.house" id="fh1">
<field name="id">1</field>
<field name="name">House's in Breizh</field>
<field name="family_geek_ids">1</field>
</record>
<record model="family.house" id="fh2">
<field name="id">2</field>
<field name="name">House's in French Guyana</field>
<field name="family_geek_ids">1</field>
</record>
<record model="family.house" id="fh3">
<field name="id">3</field>
<field name="name">House's in Mayotte</field>
<field name="family_geek_ids">1</field>
</record>
Helps please !!!