title: Adding fields from a different object into a form in OpenERP
body: <p>I would like to add fields from my product.product to my newly created Expense form (legacy_expense) which inherits hr.expense.expense. I created this module to edit the workflow of the Expense Management module - this I managed to do fine.</p>
  
  <p>I'm new to OpenERP and am having trouble getting this to work. I tried inheriting the many2one product_id field in the form through my .py field and then get it to show in the xml but it always comes up with the error "XMLSyntaxError: attributes construct error, line 25, column 13"</p>
  
  <p>I'm guessing my inheritance ins't correct and I have no idea how to relate the two objects. If someone could help me out with this it'll be great!</p>
  
  <p><strong>This is my customised legacy_expense.py file:</strong></p>
  
  <pre><code>from openerp.osv import fields, osv
  
  class legacy_expense(osv.osv):
  
  
          _inherit = 'hr.expense.expense'
  
          _columns = {
          'state': fields.selection([
  
          ('draft', 'New'),
          ('cancelled', 'Refused'),
          ('confirm', 'Waiting Approval'),
          ('done', 'Paid'),
  
          ], 'Order State', readonly= False, select=True),
  
  
          'product_id': fields.many2one('product.product','Product',required=True),
  
  
    }
  
  legacy_expense()
  </code></pre>
  
  <p><strong>This is the legacy_expense.xml file:</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;openerp&gt;
    &lt;data&gt;
      &lt;record id = "view_expenses_form_custom" model="ir.ui.view"&gt;
          &lt;field name="name"&gt;view.expenses.form.custom&lt;/field&gt;
          &lt;field name="model"&gt;hr.expense.expense&lt;/field&gt;
          &lt;field name="type"&gt;form&lt;/field&gt;
          &lt;field name="inherit_id" ref="hr_expense.view_expenses_form" /&gt;
          &lt;field name="arch" type="xml"&gt;
  
                  &lt;data&gt;
                      &lt;header&gt;
                          &lt;button name="signal_draft_to_confirm" states="draft" string="Submit" type="workflow" groups="base.group_hr_user" /&gt;
                      &lt;/header&gt;
  
                  &lt;header&gt;
                          &lt;button name="signal_confirm_to_done" states="confirm" string="Approve Expense" type="workflow" groups="base.group_hr_user" /&gt;
                      &lt;/header&gt;
  
                  &lt;header&gt;
                          &lt;button name="signal_confirm_to_refused" states="confirm" string="Reject Expense" type="workflow" groups="base.group_hr_user" /&gt;
                      &lt;/header&gt;
                  &lt;/data&gt;
          &lt;xpath expr = "/form/sheet/group/group[2]/field[@name='user_valid']"position="after"&gt;
                  &lt;field name="product_id"/&gt;
          &lt;/xpath&gt;
          &lt;/field&gt;
      &lt;/record&gt;
  &lt;/data&gt;
  &lt;/openerp&gt;
  </code></pre>
  
  <p>Again, thanks in advance to anyone who can help!</p>