1

I am trying to create data file using XML, so I can load predefined configuration during the instalation of my module. However, I couldn't insert the ID of the default company (company_id) which exists in res.company model ( I tried both eval, and ref, but both didn't work for me). I also thought in creating an external ID for a specific record (with given name) then using ref to reference this record but havent' found a way to make it.

    <record id="!!!!!!!!" model="mis.report.instance">

              <field name="name">Balance Sheet</field>

              <field name="report_id" ref=" !!!!!!!!!!!!" />

              <field name="target_move">all</field>

              <field name="hide_analytic_filters">True</field>

              <field name="company_id"  ref="how to reference the default company ID"  ></field>


  </record>
Chems B
  • 11
  • 1
  • Use [base.main_company](https://github.com/odoo/odoo/blob/13.0/odoo/addons/base/data/res_company_data.xml#L12) external id. – Kenly Nov 23 '20 at 13:35
  • @kenly thaks alot, Now, I am getting this error: AssertionError: Element odoo has extra content: record, line 16. Any additional help would be very appreciated ))) – Chems B Nov 23 '20 at 14:42
  • You have just to use the same structure as the `res_company_data.xml`. – Kenly Nov 23 '20 at 14:51
  • Hi, it works pretty well, thanks alot )) – Chems B Nov 24 '20 at 08:27

0 Answers0