Hi,
To create a data file for many2many and one2many,
first you need to create data in the one2many or many2many model. Then
link that data file to the main model.
<record id="employee_category_2" model="hr.employee.category">
<field name="name">Sales</field>
</record>
<record id="employee_fp" model="hr.employee">
<field name="name">Pieter Parker</field>
<field name="user_id" ref="base.user_root"/>
<field name="department_id" ref="dep_management"/>
<field name="job_id" ref="hr.job_ceo"/>
<field name="category_ids" eval="[(6, 0, [ref('employee_category_2')])]"/>
<field name="work_location">Building 1, Second Floor</field>
<field name="work_phone">+3281813700</field>
<field name="work_email">pieter@openerp.com</field>
<field name="image" type="base64" file="hr/static/img/employee_fp-image.jpg"/>
</record>
You can refer more from this link:
https://github.com/odoo/odoo/blob/9.0/addons/hr/hr_demo.xml" target="_blank" data-saferedirecturl="https://github.com/odoo/odoo/blob/9.0/addons/hr/hr_demo.xml
" rel="ugc">https://www.google.com/url?q=https://github.com/odoo/odoo/blob/9.0/addons/hr/hr_demo.xml&source=gmail&ust=1691503901030000&usg=AOvVaw0qj7PFExwbprYOcbgO6-rE">https://github.com/odoo/odoo/
blob/9.0/addons/hr/hr_demo.xmlHope it helps