title: Field does not exist error when inheriting account.invoice
body: <p>Using Odoo 10 (fetched from GitHub commit <a href="https://github.com/odoo/odoo/commit/7413b2624c6554bf641c2426c45c70fd59bc7490" rel="nofollow noreferrer"><code>7413b26</code></a>, branch <code>10.0</code>), installing a module which I'm porting over from Odoo 8 fails due to not finding a field in an inherited <code>account.invoice</code>. Problem is, this field <em>is</em> created within the inherited model, and the problem persists down to the point of being able to create a <a href="https://stackoverflow.com/help/mcve">MCVE</a> to illustrate the behavior:</p>
  
  <p><code>invoice.py</code>:</p>
  
  <pre class="lang-py prettyprint-override"><code>from odoo import fields, models
  class AccountInvoice(models.Model):
      _inherit = 'account.invoice'
      a = fields.Char()
  </code></pre>
  
  <p><code>invoice.xml</code>:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;openerp&gt;
      &lt;data&gt;
          &lt;record model="ir.ui.view" id="account_invoice_form_view"&gt;
              &lt;field name="name"&gt;account.invoice.form&lt;/field&gt;
              &lt;field name="model"&gt;account.invoice&lt;/field&gt;
              &lt;field name="type"&gt;form&lt;/field&gt;
              &lt;field name="inherit_id" ref="account.invoice_form"/&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;field name="origin" position="after" &gt;
                      &lt;field name="a" /&gt;
                  &lt;/field&gt;
              &lt;/field&gt;
          &lt;/record&gt;
      &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>
  
  <p>The <code>__manifest__.py</code> is <code>{'name':'Invoice bug','depends':['account'],'data':['invoice.xml'],'installable':True}</code> and <code>__init__.py</code> is just the usual <code>import invoice</code>.</p>
  
  <p>Such code fails with a</p>
  
  <pre><code>ParseError: "Error while validating constraint
  Field `a` does not exist
  Error context:
  View `account.invoice.form`
  [view_id: 554, xml_id: invoice_bug.account_invoice_form_view, model: account.invoice, parent_id: 421]
  None" while parsing /odoo/addons/invoice_bug/invoice.xml:4, near
  [XML follows]
  </code></pre>
  
  <p>Here are some more observations:</p>
  
  <ul>
  <li>Inheriting another model and view, such as <code>product.template</code> and view <code>product.product_template_only_form_view</code> (with <code>&lt;field name="default_code" position="after"&gt;</code>, works properly</li>
  <li>Using <code>&lt;xpath expr="//field[@name='origin']" position="after"&gt;</code> instead of a <code>field position="after"</code> does not affect the error</li>
  <li>Other modules, such as the native <code>sale</code> module, succeeds in extending <code>account.invoice</code> and the same view (<code>account.invoice_form</code>) properly:  <a href="https://github.com/odoo/odoo/blob/7413b2624c6554bf641c2426c45c70fd59bc7490/addons/sale/models/account_invoice.py#L8" rel="nofollow noreferrer">sale/models/account_invoice.py:8</a>, <a href="https://github.com/odoo/odoo/blob/7413b2624c6554bf641c2426c45c70fd59bc7490/addons/sale/views/sale_views.xml#L653" rel="nofollow noreferrer">sale/views/sale_views.xml:653</a></li>
  <li>A <a href="https://bugs.launchpad.net/openobject-server/+bug/1026578" rel="nofollow noreferrer">similar bug exists since OpenERP 7</a></li>
  <li>An Odoo forum member seemingly <a href="https://www.odoo.com/forum/help-1/question/how-to-add-columns-to-account-invoice-new-api-72798" rel="nofollow noreferrer">had the same problem</a> with Odoo 8 or 9 (the provided example leads to the same error, provided you replace the now-deleted reference to <code>period_id</code> with <code>date</code>)</li>
  <li>The bug triggers regardless of installed modules or stored records (tested on a clean DB + 3 other installs)</li>
  </ul>
  
  <p>Is my code wrong, or is there a workaround ?</p>