title: Odoo use id of just created record
body: <p>I need to create company and right away create contact that bound to that company:</p>
  
  <pre><code>vals = {...}
  company = self.env['res.partner'].create(vals)
  vals = {'company_id': company.id, ...}
  contact = self.env['res.partner'].create(vals)
  </code></pre>
  
  <p>But odoo says: DETAIL:  Key (company_id)=(49) is not present in table "res_company".</p>
  
  <p>Transaction is not commited yet (as i suppose).
  So how can i use field of just created records?</p>
  
  <p>Method launched in ir.cron:</p>
  
  <p>Method called like this:</p>
  
  <pre><code>&lt;record model="ir.cron" id="ir_cron_load_data"&gt;
      &lt;field name="name"&gt;Load&lt;/field&gt;
      &lt;field eval="False" name="active" /&gt;
      &lt;field name="interval_number"&gt;24&lt;/field&gt;
      &lt;field name="interval_type"&gt;hours&lt;/field&gt;
      &lt;field name="numbercall"&gt;-1&lt;/field&gt;
      &lt;field name="priority"&gt;100&lt;/field&gt;
      &lt;field name="doall" eval="False"/&gt;
      &lt;field name="model" eval="'sap_contacts'"/&gt;
      &lt;field name="function" eval="'action_load_data'"/&gt;
      &lt;field name="args" eval="'()'"/&gt;
  &lt;/record&gt;
  </code></pre>