title: how to add field to product.template in odoo 12
body: <p>I would like to display a field in Form View of the product module, here is the python file (i use odoo 12.):</p>
  
  <pre><code>class ClassProductInherited:
      _inherit = 'product.template'
  
      file = fields.Char(string="Choose File")
  </code></pre>
  
  <p>Here is xml code (i use odoo 12.):</p>
  
  <pre><code>&lt;record id="view_product_form_inherit" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;product.template.common.form.inherit&lt;/field&gt;
              &lt;field name="model"&gt;product.template&lt;/field&gt;
              &lt;field name="inherit_id" ref="product.product_template_only_form_view"/&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;xpath expr="//page[@name='inventory']/group" position="before"&gt;
                      &lt;group col="2" colspan="2"&gt;
                          &lt;field name="file"/&gt;
                      &lt;/group&gt;
                  &lt;/xpath&gt;
  
              &lt;/field&gt;
          &lt;/record&gt;
  </code></pre>
  
  <p>When I restart the server, problem is that I have the following error:</p>
  
  <pre><code>File "/home/odoo/models.py", line 1112, in _validate_fields
      raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
  odoo.tools.convert.ParseError: "Error while validating constraint
  
  Field `file` does not exist
  
  Error context:
  View `product.template.common.form.inherit`
  [view_id: 2095, xml_id: module.view_product_form_inherit, model: product.template, parent_id: 402]
  None" while parsing /home/omar/odoo/custom-addons/addons12/module/views/views.xml:403, near
  &lt;record id="view_product_form_inherit" model="ir.ui.view"&gt;
              &lt;field name="name"&gt;product.template.common.form.inherit&lt;/field&gt;
              &lt;field name="model"&gt;product.template&lt;/field&gt;
              &lt;field name="inherit_id" ref="product.product_template_only_form_view"/&gt;
              &lt;field name="arch" type="xml"&gt;
                  &lt;xpath expr="//page[@name='inventory']/group" position="before"&gt;
                      &lt;group col="2" colspan="2"&gt;
                          &lt;field name="file"/&gt;
                      &lt;/group&gt;
                  &lt;/xpath&gt;
  
              &lt;/field&gt;
          &lt;/record&gt;
  </code></pre>